Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-01-25 14:21:56 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-01-25 14:21:56 +0300
commit27ac64346fa0231a6a9a6e986ca460923f6b4b65 (patch)
tree15e0a253468ce9a89347cb0a28814c244fa27adf /winsup/cygwin
parentaced35f8834dd26101b41fbab6713b04459f5775 (diff)
* spawn.cc (spawn_guts): Only try to remove long path prefix from
runpath if runpath is not NULL.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/spawn.cc35
2 files changed, 23 insertions, 17 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 89b3252bc..518d0e3a5 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2010-01-25 Corinna Vinschen <corinna@vinschen.de>
+ * spawn.cc (spawn_guts): Only try to remove long path prefix from
+ runpath if runpath is not NULL.
+
+2010-01-25 Corinna Vinschen <corinna@vinschen.de>
+
* nlsfuncs.cc (__get_lcid_from_locale): Fix a comment. Handle special
language/TERRITORY combinations explicitely. Explain why.
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index fdbab76aa..c1033376c 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -489,23 +489,24 @@ 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) = L'\\';
- if (!RtlIsDosDeviceName_U (r))
- runpath = r;
- else if (*r == L'\\')
- *r = L'C';
- }
- }
+ if (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) = L'\\';
+ if (!RtlIsDosDeviceName_U (r))
+ runpath = r;
+ else if (*r == L'\\')
+ *r = L'C';
+ }
+ }
syscall_printf ("null_app_name %d (%W, %.9500W)", null_app_name,
runpath, wone_line);