diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2021-04-05 17:32:13 +0900 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2021-04-06 12:14:36 +0200 |
commit | ba2fbfec95b03ccd01c4d3f5a5179e7cc5f95e19 (patch) | |
tree | 69ec4fd79b52594be2f3acd4fbdf02cd54c142e1 | |
parent | fdda29fb57cb2958b941bc7315493e73137e2ecf (diff) | |
download | newlib-ba2fbfec95b03ccd01c4d3f5a5179e7cc5f95e19.zip newlib-ba2fbfec95b03ccd01c4d3f5a5179e7cc5f95e19.tar.gz newlib-ba2fbfec95b03ccd01c4d3f5a5179e7cc5f95e19.tar.bz2 |
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.
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 12247dd..d78afb3 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -183,19 +183,20 @@ CreateProcessA_Hooked char *p = prog; char *p1; 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 == ' ') { *p = '\0'; - path.check (prog); + find_exec (prog, path); *p = ' '; + p ++; } else if (*p == '\0') - path.check (prog); + find_exec (prog, path); } - while (!path.exists() && p1); + while (!path.exists() && *p); } const char *argv[] = {"", NULL}; /* Dummy */ av av1; @@ -239,19 +240,20 @@ CreateProcessW_Hooked char *p = prog; char *p1; 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 == ' ') { *p = '\0'; - path.check (prog); + find_exec (prog, path); *p = ' '; + p ++; } else if (*p == '\0') - path.check (prog); + find_exec (prog, path); } - while (!path.exists() && p1); + while (!path.exists() && *p); } const char *argv[] = {"", NULL}; /* Dummy */ av av1; |