home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / WATCOM_C / WAT139.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-18  |  941 b   |  36 lines

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat139.c                                             */
  3. /*------------------------------------------------------------------*/
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <process.h>
  7.  
  8. void main()
  9. {
  10.    char *path, *environment;
  11.  
  12.    /* └≥¿·Ñ╪½e¬║ path └⌠╣╥│]⌐w */
  13.    environment = getenv("PATH");
  14.    if (environment != NULL)
  15.    {
  16.         printf("Ñ╪½e¬║ path └⌠╣╥│]⌐w¼░ : \n");
  17.         printf("PATH=%s\n",environment);
  18.    }
  19.  
  20.    /* │]⌐w╖s¬║ path */
  21.    path = malloc(strlen(environment)+15);
  22.    strcpy(path,"PATH=");
  23.    strcat(path,environment);
  24.    strcat(path,";C:\\TEST");
  25.  
  26.    /* ┤└┤½Ñ╪½e¬║ path, ¿├┼πÑ▄╖s¬║ path */
  27.    putenv(path);
  28.    environment = getenv("PATH");
  29.    if ( environment != NULL )
  30.    {
  31.         printf("\n");
  32.         printf("Ñ╪½e¬║ path └⌠╣╥│]⌐w¼░ : \n");
  33.         printf("PATH=%s\n",environment);
  34.    }
  35. }
  36.