This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: gcc/java/parse.y: Improper DIR_SEPARATOR Usage


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)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]