Commit 04c8d9b9 by Neil Booth Committed by Neil Booth

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

From-SVN: r40236
parent 7868b4a2
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
copy of the filename. Don't use CPP_PREV_BUFFER. Don't call
strlen or strcpy; we already know the length.
......
......@@ -804,7 +804,11 @@ search_from (pfile, inc)
if (CPP_OPTION (pfile, ignore_srcdir))
return CPP_OPTION (pfile, quote_include);
dlen = basename (inc->name) - inc->name;
/* 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment