* cppfiles.c (search_from): Special case the empty string.

From-SVN: r40236
This commit is contained in:
Neil Booth 2001-03-04 15:10:46 +00:00 committed by Neil Booth
parent 7868b4a252
commit 04c8d9b90a
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2001-03-04 Neil Booth <neil@daikokuya.demon.co.uk>
* cppfiles.c (search_from): Special case the empty string.
2001-03-04 Neil Booth <neil@daikokuya.demon.co.uk>
* cppfiles.c (_cpp_execute_include): Don't make a null-terminated

View File

@ -804,7 +804,11 @@ search_from (pfile, inc)
if (CPP_OPTION (pfile, ignore_srcdir))
return CPP_OPTION (pfile, quote_include);
/* basename () on Solaris returns "." for an empty string. */
dlen = 0;
if (inc->name[0] != '\0')
dlen = basename (inc->name) - inc->name;
if (dlen)
{
/* We don't guarantee NAME is null-terminated. This saves