This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: gcc/java/parse.y: Improper DIR_SEPARATOR Usage
- From: Ranjit Mathew <rmathew at hotmail dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Fri, 30 Aug 2002 18:38:16 +0530
- Subject: Patch: gcc/java/parse.y: Improper DIR_SEPARATOR Usage
- Newsgroups: gmane.comp.gcc.java.patches
Hi,
The MinGW specific config file
(gcc/config/i386/xm-mingw32.h) defines '/' as
DIR_SEPARATOR and '\\' as DIR_SEPARATOR_2. The original
parse.y code is thus buggy w.r.t. a MinGW host.
The following patch uses the standard GCC macro
IS_DIR_SEPARATOR( ) (defined in gcc/system.h), which
correctly handles this case:
------------------------ 8< --------------------------
--- parse.y Fri Aug 30 18:28:22 2002
+++ parse.y.new Fri Aug 30 18:32:43 2002
@@ -3451,10 +3451,10 @@
/* Contains OS dependent assumption on path separator. FIXME */
for (f = &input_filename [strlen (input_filename)];
- f != input_filename && f[0] != '/' && f[0] != DIR_SEPARATOR;
+ f != input_filename && !(IS_DIR_SEPARATOR( f[0]));
f--)
;
- if (f[0] == '/' || f[0] == DIR_SEPARATOR)
+ if (IS_DIR_SEPARATOR( f[0]))
f++;
if (strncmp (IDENTIFIER_POINTER (raw_name),
f , IDENTIFIER_LENGTH (raw_name)) ||
------------------------ 8< --------------------------
Sincerely Yours,
Ranjit Mathew.
(rmathew_AT_hotmail_DOT_com)