summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/spawn.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-06-02 21:20:54 +0000
committerChristopher Faylor <me@cgf.cx>2004-06-02 21:20:54 +0000
commit1a21f33188bf4530967c644e0e540b6b7db09c1d (patch)
tree00365e98d11979d42185c9d83ccdf15f3cf7eb2d /winsup/cygwin/spawn.cc
parent8b57e664af6cedcbd20a5f4c37ee364b5e13e97a (diff)
downloadcygnal-1a21f33188bf4530967c644e0e540b6b7db09c1d.tar.gz
cygnal-1a21f33188bf4530967c644e0e540b6b7db09c1d.tar.bz2
cygnal-1a21f33188bf4530967c644e0e540b6b7db09c1d.zip
* spawn.cc (find_exec): Use has_slash to determine if path has a slash rather
than calculating this twice.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index dc2bb254c..225e1ce0f 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -114,11 +114,9 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv,
/* Return the error condition if this is an absolute path or if there
is no PATH to search. */
- if (strchr (name, '/') || strchr (name, '\\') ||
- isdrive (name) ||
- !(winpath = getwinenv (mywinenv)) ||
- !(path = winpath->get_native ()) ||
- *path == '\0')
+ if (has_slash || strchr (name, '\\') || isdrive (name)
+ || !(winpath = getwinenv (mywinenv))
+ || !(path = winpath->get_native ()) || *path == '\0')
goto errout;
debug_printf ("%s%s", mywinenv, path);