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
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2009-08-01 07:27:51 +0400
committerChristopher Faylor <me@cgf.cx>2009-08-01 07:27:51 +0400
commit5f297dc3307b540bb1d594f719df5730beaedc57 (patch)
tree9e8a70fa9f7f2ac2b24397d1c2fe579a5ff36ac5 /winsup
parentf4a7842850cd874fd1cd3931a8819a9fc5e93517 (diff)
* spawn.cc (find_exec): Stop relying on the ability to set retval to a fixed
path_conv buffer and set it on the fly instead.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/spawn.cc12
2 files changed, 13 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 69acf32be..b83909945 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-31 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * spawn.cc (find_exec): Stop relying on the ability to set retval to a
+ fixed path_conv buffer and set it on the fly instead.
+
2009-07-30 Corinna Vinschen <corinna@vinschen.de>
* path.h (cstrdup): Fix declaration.
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 09b9cd80f..06bf1e00e 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -109,7 +109,7 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv,
{
const char *suffix = "";
debug_printf ("find_exec (%s)", name);
- const char *retval = buf.get_win32 ();
+ const char *retval;
tmp_pathbuf tp;
char *tmp = tp.c_get ();
const char *posix = (opt & FE_NATIVE) ? NULL : name;
@@ -129,6 +129,7 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv,
strcpy (tmp + 2, name);
posix = tmp;
}
+ retval = buf.get_win32 ();
goto out;
}
@@ -198,10 +199,13 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv,
Take the appropriate action based on null_if_not_found. */
if (opt & FE_NNF)
retval = NULL;
- else if (opt & FE_NATIVE)
- buf.check (name);
- else
+ else if (!(opt & FE_NATIVE))
retval = name;
+ else
+ {
+ buf.check (name);
+ retval = buf.get_win32 ();
+ }
out:
if (posix)