* cppfiles.c (search_from): Special case the empty string.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Sun, 4 Mar 2001 15:10:46 +0000 (15:10 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Sun, 4 Mar 2001 15:10:46 +0000 (15:10 +0000)
From-SVN: r40236

gcc/ChangeLog
gcc/cppfiles.c

index 7a1772bb87e4079dcea82f46716770d448f3a142..029af4bc803eb2f624afe9e0f4a4a7c490b89bb6 100644 (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
index 0dfd9d0db66c0f2f7a0f69ce9adc3342b844fd09..7f15a8d24cace27e3b49aa2e879b2ed35d905b47 100644 (file)
@@ -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