update for HEAD-2003091401
[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 /*
10  * @implemented
11  */
12 void _searchenv(const char *file,const char *var,char *path )
13 {
14         char *env = getenv(var);
15         char *x;
16         char *y;
17         char *FilePart;
18
19         DPRINT("_searchenv()\n");
20
21         x = strchr(env,'=');
22         if ( x != NULL ) {
23                 *x = 0;
24                 x++;
25         }
26         y = strchr(env,';');
27         while ( y != NULL ) {
28                 *y = 0;
29                 if ( SearchPathA(x,file,NULL,MAX_PATH,path,&FilePart) > 0 ) {
30                                 return;
31                 }
32                 x = y+1;
33                 y = strchr(env,';');
34         }
35         return;
36 }