230 |
int i, rc; |
int i, rc; |
231 |
|
|
232 |
/* Search the directory for the program. */ |
/* Search the directory for the program. */ |
233 |
for (i = 0; i < n_exts; i++) |
for (i = 0; i < n_exts; i++) |
234 |
{ |
{ |
235 |
rc = SearchPath (dir, exec, exts[i], bufsize, buffer, &dummy); |
rc = SearchPath (dir, exec, exts[i], bufsize, buffer, &dummy); |
236 |
if (rc > 0) |
if (rc > 0) |
240 |
return 0; |
return 0; |
241 |
} |
} |
242 |
|
|
243 |
/* Return the absolute name of executable file PROG, including |
/* Return the absolute name of executable file PROG, including |
244 |
any file extensions. If an absolute name for PROG cannot be found, |
any file extensions. If an absolute name for PROG cannot be found, |
245 |
return NULL. */ |
return NULL. */ |
246 |
char * |
char * |
272 |
return NULL; |
return NULL; |
273 |
} |
} |
274 |
|
|
275 |
if (GetCurrentDirectory (MAX_PATH, curdir) <= 0) |
if (GetCurrentDirectory (MAX_PATH, curdir) <= 0) |
276 |
return NULL; |
return NULL; |
277 |
|
|
278 |
/* Relative path; search in current dir. */ |
/* Relative path; search in current dir. */ |
279 |
if (strpbrk (prog, "\\")) |
if (strpbrk (prog, "\\")) |
280 |
{ |
{ |
281 |
if (search_dir (curdir, prog, MAX_PATH, absname) > 0) |
if (search_dir (curdir, prog, MAX_PATH, absname) > 0) |
282 |
return strdup (absname); |
return strdup (absname); |
283 |
else |
else |
284 |
return NULL; |
return NULL; |
285 |
} |
} |
286 |
|
|
287 |
/* Just filename; search current directory then PATH. */ |
/* Just filename; search current directory then PATH. */ |
288 |
path = alloca (strlen (getenv ("PATH")) + strlen (curdir) + 2); |
path = alloca (strlen (getenv ("PATH")) + strlen (curdir) + 2); |
289 |
strcpy (path, curdir); |
strcpy (path, curdir); |
304 |
|
|
305 |
/* Move to the next directory. */ |
/* Move to the next directory. */ |
306 |
path = p + 1; |
path = p + 1; |
307 |
} |
} |
308 |
|
|
309 |
return NULL; |
return NULL; |
310 |
} |
} |
322 |
char * cmdline = GetCommandLine (); |
char * cmdline = GetCommandLine (); |
323 |
int arg_bytes = 0; |
int arg_bytes = 0; |
324 |
|
|
325 |
|
|
326 |
} |
} |
327 |
#endif |
#endif |
328 |
|
|
384 |
sec_attrs.nLength = sizeof (sec_attrs); |
sec_attrs.nLength = sizeof (sec_attrs); |
385 |
sec_attrs.lpSecurityDescriptor = NULL; |
sec_attrs.lpSecurityDescriptor = NULL; |
386 |
sec_attrs.bInheritHandle = FALSE; |
sec_attrs.bInheritHandle = FALSE; |
387 |
|
|
388 |
memset (&start, 0, sizeof (start)); |
memset (&start, 0, sizeof (start)); |
389 |
start.cb = sizeof (start); |
start.cb = sizeof (start); |
390 |
|
|