b87dcb65276b14ae41a85342ac7fb579efb491f9
[reactos.git] / lib / crtdll / stdlib / senv.c
1 #include <windows.h>
2 #include <msvcrt/stdlib.h>
3 #include <msvcrt/string.h>
4
5 #define NDEBUG
6 #include <msvcrt/msvcrtdbg.h>
7
8
9 void _searchenv(const char *file,const char *var,char *path )
10 {
11         char *env = getenv(var);
12         char *x;
13         char *y;
14         char *FilePart;
15
16         DPRINT("_searchenv()\n");
17
18         x = strchr(env,'=');
19         if ( x != NULL ) {
20                 *x = 0;
21                 x++;
22         }
23         y = strchr(env,';');
24         while ( y != NULL ) {
25                 *y = 0;
26                 if ( SearchPathA(x,file,NULL,MAX_PATH,path,&FilePart) > 0 ) {
27                                 return;
28                 }
29                 x = y+1;
30                 y = strchr(env,';');
31         }
32         return;
33 }