home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_11 / 8n11034a < prev    next >
Text File  |  1990-09-18  |  459b  |  29 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. main()
  6. {
  7.     char filename[21];
  8.     char env_var[21];
  9.     char path[61];
  10.  
  11.     while (scanf("%20s %20s", filename, env_var) != EOF) {
  12.         _searchenv(filename, env_var, path);
  13.         if (*path == '\0')
  14.             printf("no such file\n");
  15.         else
  16.             printf("path is >%s<\n", path);
  17.     }
  18. }
  19.  
  20. link.exe path
  21. no such file
  22. link.exe PATH
  23. path is >c:\dos\link.exe<
  24. LINK.exe PATH
  25. path is >c:\dos\LINK.exe<
  26. dummy PATH
  27. no such file
  28.  
  29.