diff options
author | Christopher Faylor <me@cgf.cx> | 2005-05-22 03:54:29 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-05-22 03:54:29 +0000 |
commit | f82ca06eda7ea47511d97b9b5018f78ae82715ef (patch) | |
tree | 1a7724d7db5eb1954a2633a55c6b4dc75ac9e141 /winsup/cygwin/spawn.cc | |
parent | f609f58d32ed91f857135cfc8b76ccba1b24e2e1 (diff) | |
download | cygnal-f82ca06eda7ea47511d97b9b5018f78ae82715ef.tar.gz cygnal-f82ca06eda7ea47511d97b9b5018f78ae82715ef.tar.bz2 cygnal-f82ca06eda7ea47511d97b9b5018f78ae82715ef.zip |
* spawn.cc (find_exec): Accept a PATH-like string in place of an environment
variable.
* dlfcn.cc (get_full_path_of_dll): Search /usr/bin (for windows compatibility)
and /usr/lib (for UNIX compatibility) when looking for shared libraries.
* environ.cc (conv_envvars): Put back LD_LIBRARY_PATH since it is used by
get_full_path_of_dll().
* errno.cc (errmap): Map MOD_NOT_FOUND to ENOENT.
* cygmagic: Remove debugging cruft.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r-- | winsup/cygwin/spawn.cc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index b65e00320..9faec772e 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -111,17 +111,28 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv, const char *path; const char *posix_path; - /* Return the error condition if this is an absolute path or if there - is no PATH to search. */ - if (has_slash || strchr (name, '\\') || isdrive (name) + posix = (opt & FE_NATIVE) ? NULL : tmp; + + if (strchr (mywinenv, '/')) + { + /* it's not really an environment variable at all */ + int n = cygwin_posix_to_win32_path_list_buf_size (mywinenv); + char *s = (char *) alloca (n + 1); + if (cygwin_posix_to_win32_path_list (mywinenv, s)) + goto errout; + path = s; + posix_path = mywinenv - 1; + } + else if (has_slash || strchr (name, '\\') || isdrive (name) || !(winpath = getwinenv (mywinenv)) || !(path = winpath->get_native ()) || *path == '\0') + /* Return the error condition if this is an absolute path or if there + is no PATH to search. */ goto errout; + else + posix_path = winpath->get_posix () - 1; debug_printf ("%s%s", mywinenv, path); - - posix = (opt & FE_NATIVE) ? NULL : tmp; - posix_path = winpath->get_posix () - 1; /* Iterate over the specified path, looking for the file with and without executable extensions. */ do |