(take 2): patch for #pragma interfac/implementation bug.

Mumit Khan khan@xraylith.wisc.edu
Sat Jan 31 10:33:00 GMT 1998


The tests for '/' and DIR_SEPARATOR are both needed to handle cases like
the following:
   
   #include <foo/foo.h>

Where cpp might expand the above to the following:
   # 1 "c:\\tmp\\inctest/foo.h" 1

And cc1plus gets the wrong basename (inctest/foo.h instead of foo.h),
and we lose. The other solution is to make cpp more consistent of course.

Here's the original patch applied to 980129.

Tue Jan  6 01:42:44 1998  Mumit Khan <khan@xraylith.wisc.edu>

	* lex.c (DIR_SEPARATOR): Define to be '/' if not already defined.
	(file_name_nondirectory): Use.

Index: cp/lex.c
===================================================================
RCS file: /usr/local/src/CVSROOT/egcs/gcc/cp/lex.c,v
retrieving revision 1.1.1.2
retrieving revision 1.4
diff -u -p -r1.1.1.2 -r1.4
--- lex.c	1998/01/31 08:10:27	1.1.1.2
+++ lex.c	1998/01/31 17:55:35	1.4
@@ -108,7 +108,9 @@ char *
 file_name_nondirectory (x)
      char *x;
 {
-  char *tmp = (char *) rindex (x, DIR_SEPARATOR);
+  char *tmp = (char *) rindex (x, '/');
+  if (DIR_SEPARATOR != '/' && ! tmp)
+    tmp = (char *) rindex (x, DIR_SEPARATOR);
   if (tmp)
     return (char *) (tmp + 1);
   else

Regards,
Mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/



More information about the Gcc-bugs mailing list