This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix preprocessor/11839
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 9 Aug 2003 09:55:01 +0100
- Subject: Fix preprocessor/11839
My cppfiles.c rewrite fixed the case where a file was unreadable
(we wouldn't complain, and continue searching) but missed the
case where a path component is a file. I tried to create a
testcase for this, and failed.
Neil.
PR preprocessor/11839
* cppfiles.c (open_file): Handle ENOTDIR.
Index: cppfiles.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppfiles.c,v
retrieving revision 1.184
diff -u -p -r1.184 cppfiles.c
--- cppfiles.c 3 Aug 2003 09:28:23 -0000 1.184
+++ cppfiles.c 8 Aug 2003 22:14:19 -0000
@@ -230,6 +230,8 @@ open_file (_cpp_file *file)
close (file->fd);
file->fd = -1;
}
+ else if (errno == ENOTDIR)
+ errno = ENOENT;
file->err_no = errno;