* 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.
This commit is contained in:
Christopher Faylor 2009-08-01 17:55:58 +00:00
parent a3a060b596
commit 8cc84a8ce3
3 changed files with 11 additions and 5 deletions

View File

@ -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> 2009-07-31 Christopher Faylor <me+cygwin@cgf.cx>
* spawn.cc (find_exec): Fix one more path where retval was not set. * spawn.cc (find_exec): Fix one more path where retval was not set.

View File

@ -232,7 +232,7 @@ class path_conv
bool fs_is_cdrom () const {return fs.is_cdrom ();} bool fs_is_cdrom () const {return fs.is_cdrom ();}
bool fs_is_mvfs () const {return fs.is_mvfs ();} bool fs_is_mvfs () const {return fs.is_mvfs ();}
ULONG fs_serial_number () const {return fs.serial_number ();} 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); void fillin (HANDLE h);
bool is_binary (); bool is_binary ();

View File

@ -87,12 +87,12 @@ perhaps_suffix (const char *prog, path_conv& buf, int& err, unsigned opt)
return ext; return ext;
} }
inline void inline char *
path_conv::set_path (const char *p) path_conv::set_path (const char *p)
{ {
if (path) if (path)
cfree (path); cfree (path);
path = cstrdup (p); return path = cstrdup (p);
} }
/* Find an executable name, possibly by appending known executable /* 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: out:
if (posix) if (posix)
buf.set_path (posix); retval = buf.set_path (posix);
debug_printf ("%s = find_exec (%s)", (char *) buf.get_win32 (), name); debug_printf ("%s = find_exec (%s)", (char *) buf.get_win32 (), name);
if (known_suffix) if (known_suffix)
*known_suffix = suffix ?: strchr (buf.get_win32 (), '\0'); *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 (argv[1]);
one_line.add (" "); one_line.add (" ");
one_line.add (argv[2]); one_line.add (argv[2]);
strcpy (real_path.get_win32 (), argv[0]); real_path.set_path (argv[0]);
null_app_name = true; null_app_name = true;
} }
else else