diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-07-22 16:59:59 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-07-22 16:59:59 +0000 |
commit | 19dc8ba9b200524f1e28281edab26510754239aa (patch) | |
tree | ff11d0f70bf78c0d240a257953e8b8612c86a8b3 /winsup | |
parent | a1e199034882ebf25918021d2d30962928e997d6 (diff) | |
download | cygnal-19dc8ba9b200524f1e28281edab26510754239aa.tar.gz cygnal-19dc8ba9b200524f1e28281edab26510754239aa.tar.bz2 cygnal-19dc8ba9b200524f1e28281edab26510754239aa.zip |
* spawn.cc (spawn_guts): Remove long path prefix from win32 path
before calling CreateProcess if path length is < MAX_PATH.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/spawn.cc | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c703056b3..ad31bd2d5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2008-07-22 Corinna Vinschen <corinna@vinschen.de> + * spawn.cc (spawn_guts): Remove long path prefix from win32 path + before calling CreateProcess if path length is < MAX_PATH. + +2008-07-22 Corinna Vinschen <corinna@vinschen.de> + * include/ctype.h: Declare __ctype_ptr__ to keep newlib build happy. 2008-07-21 Corinna Vinschen <corinna@vinschen.de> diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index f90ffbcea..0a94282f0 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -472,6 +472,20 @@ spawn_guts (const char *prog_arg, const char *const *argv, } runpath = null_app_name ? NULL : real_path.get_wide_win32_path (runpath); + { /* If the executable path length is < MAX_PATH, make sure the long path + win32 prefix is removed from the path to make subsequent native Win32 + child processes happy which are not long path aware. */ + USHORT len = real_path.get_nt_native_path ()->Length; + if (len < (MAX_PATH + 4) * sizeof (WCHAR) + || (runpath[5] != L':' /* UNC path */ + && len < (MAX_PATH + 6) * sizeof (WCHAR))) + { + PWCHAR r = runpath + 4; + if (r[1] != L':') /* UNC path */ + r += 2; + runpath = r; + } + } syscall_printf ("null_app_name %d (%W, %.9500W)", null_app_name, runpath, wone_line); |