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:
authorChristopher Faylor <me@cgf.cx>2009-08-01 21:55:58 +0400
committerChristopher Faylor <me@cgf.cx>2009-08-01 21:55:58 +0400
commit8cc84a8ce35aa56528f24532e8a1095199f80c11 (patch)
treec88392404575b2f961815b7b9787194bc2093c4a /winsup/cygwin
parenta3a060b596e8939ec171c21d65a46f3aec3d62a8 (diff)
* path.h (path_conv::set_path): Change return value.
* spawn.cc (path_conv::set_path): Return newly set value. (find_exec): Set retval to newly set value when calling set_path.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/path.h2
-rw-r--r--winsup/cygwin/spawn.cc8
3 files changed, 11 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 92219da0c..8237ebb6a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2009-08-01 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * path.h (path_conv::set_path): Change return value.
+ * spawn.cc (path_conv::set_path): Return newly set value.
+ (find_exec): Set retval to newly set value when calling set_path.
+
2009-07-31 Christopher Faylor <me+cygwin@cgf.cx>
* spawn.cc (find_exec): Fix one more path where retval was not set.
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index 8216d24ea..98bec6fa8 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -232,7 +232,7 @@ class path_conv
bool fs_is_cdrom () const {return fs.is_cdrom ();}
bool fs_is_mvfs () const {return fs.is_mvfs ();}
ULONG fs_serial_number () const {return fs.serial_number ();}
- inline void set_path (const char *p);
+ inline char *set_path (const char *p);
void fillin (HANDLE h);
bool is_binary ();
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 105d1988f..009e53d17 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -87,12 +87,12 @@ perhaps_suffix (const char *prog, path_conv& buf, int& err, unsigned opt)
return ext;
}
-inline void
+inline char *
path_conv::set_path (const char *p)
{
if (path)
cfree (path);
- path = cstrdup (p);
+ return path = cstrdup (p);
}
/* Find an executable name, possibly by appending known executable
@@ -210,7 +210,7 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv,
out:
if (posix)
- buf.set_path (posix);
+ retval = buf.set_path (posix);
debug_printf ("%s = find_exec (%s)", (char *) buf.get_win32 (), name);
if (known_suffix)
*known_suffix = suffix ?: strchr (buf.get_win32 (), '\0');
@@ -402,7 +402,7 @@ spawn_guts (const char *prog_arg, const char *const *argv,
one_line.add (argv[1]);
one_line.add (" ");
one_line.add (argv[2]);
- strcpy (real_path.get_win32 (), argv[0]);
+ real_path.set_path (argv[0]);
null_app_name = true;
}
else