* spawn.cc (perhaps_suffix): Return NULL on non-existence of file as well as

"directoryness".  Previous code modified on 2001/09/30 actually had an arguable
bug which was unmasked by the change on that day.
This commit is contained in:
Christopher Faylor 2001-10-05 01:39:08 +00:00
parent cbed6474df
commit af39152f4c
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Thu Oct 4 21:37:57 2001 Christopher Faylor <cgf@cygnus.com>
* spawn.cc (perhaps_suffix): Return NULL on non-existence of file as
well as "directoryness". Previous code modified on 2001/09/30 actually
had an arguable bug which was unmasked by the change on that day.
Thu Oct 4 20:52:42 2001 Christopher Faylor <cgf@cygnus.com> Thu Oct 4 20:52:42 2001 Christopher Faylor <cgf@cygnus.com>
* path.cc (path_conv::check): Return ENOTDIR when leading device and * path.cc (path_conv::check): Return ENOTDIR when leading device and

View File

@ -63,7 +63,7 @@ perhaps_suffix (const char *prog, path_conv &buf)
debug_printf ("prog '%s'", prog); debug_printf ("prog '%s'", prog);
buf.check (prog, PC_SYM_FOLLOW | PC_FULL, std_suffixes); buf.check (prog, PC_SYM_FOLLOW | PC_FULL, std_suffixes);
if (buf.isdir ()) if (!buf.exists () || buf.isdir ())
ext = NULL; ext = NULL;
else if (buf.known_suffix) else if (buf.known_suffix)
ext = (char *) buf + (buf.known_suffix - buf.get_win32 ()); ext = (char *) buf + (buf.known_suffix - buf.get_win32 ());