Cygwin: pty: Use find_exec() rather than path_conv::check().

- With this patch, find_exec() rather than path_conv::check() is used
  in order to enable searching executable file in the path.
This commit is contained in:
Takashi Yano 2021-04-05 17:32:13 +09:00 committed by Corinna Vinschen
parent fdda29fb57
commit ba2fbfec95
1 changed files with 12 additions and 10 deletions

View File

@ -183,19 +183,20 @@ CreateProcessA_Hooked
char *p = prog; char *p = prog;
char *p1; char *p1;
do do
if ((p1 = strstr (p, ".exe")) || (p1 = strstr (p, ".com"))) if ((p1 = strchr (p, ' ')) || (p1 = p + strlen (p)))
{ {
p = p1 + 4; p = p1;
if (*p == ' ') if (*p == ' ')
{ {
*p = '\0'; *p = '\0';
path.check (prog); find_exec (prog, path);
*p = ' '; *p = ' ';
p ++;
} }
else if (*p == '\0') else if (*p == '\0')
path.check (prog); find_exec (prog, path);
} }
while (!path.exists() && p1); while (!path.exists() && *p);
} }
const char *argv[] = {"", NULL}; /* Dummy */ const char *argv[] = {"", NULL}; /* Dummy */
av av1; av av1;
@ -239,19 +240,20 @@ CreateProcessW_Hooked
char *p = prog; char *p = prog;
char *p1; char *p1;
do do
if ((p1 = strstr (p, ".exe")) || (p1 = strstr (p, ".com"))) if ((p1 = strchr (p, ' ')) || (p1 = p + strlen (p)))
{ {
p = p1 + 4; p = p1;
if (*p == ' ') if (*p == ' ')
{ {
*p = '\0'; *p = '\0';
path.check (prog); find_exec (prog, path);
*p = ' '; *p = ' ';
p ++;
} }
else if (*p == '\0') else if (*p == '\0')
path.check (prog); find_exec (prog, path);
} }
while (!path.exists() && p1); while (!path.exists() && *p);
} }
const char *argv[] = {"", NULL}; /* Dummy */ const char *argv[] = {"", NULL}; /* Dummy */
av av1; av av1;