parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
authorTom Tromey <tromey@cygnus.com>
Thu, 25 Feb 1999 12:36:03 +0000 (12:36 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 25 Feb 1999 12:36:03 +0000 (12:36 +0000)
* parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
When reading a zip file, only use strncmp if both strings are
bigger than the buffer length.  Initialize `k' when looping
through zip file.

From-SVN: r25439

gcc/java/ChangeLog
gcc/java/parse.c
gcc/java/parse.y

index 993ca19e69de379496f680a6af0637392cecb4e5..32486e3076d3e06c47744a4dc99abfca629fde0c 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-25  Tom Tromey  <tromey@cygnus.com>
+
+       * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
+       When reading a zip file, only use strncmp if both strings are
+       bigger than the buffer length.  Initialize `k' when looping
+       through zip file.
+
 1999-02-24  Tom Tromey  <tromey@cygnus.com>
 
        * gjavah.c (struct namelet): New structure.
index 13744dfcfc99f41a76f50c4a8bfe4b57c0096310..49b84f0e02c6a4daa4a31d0ba818e40e9f227a9d 100644 (file)
@@ -2217,7 +2217,7 @@ static const short yycheck[] = {     3,
 #define YYPURE 1
 
 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/usr/share/bison.simple"
+#line 3 "/usr/share/misc/bison.simple"
 
 /* Skeleton output parser for bison,
    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -2234,7 +2234,7 @@ static const short yycheck[] = {     3,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* As a special exception, when this file is copied by Bison into a
    Bison output file, you may use that output file without restriction.
@@ -2410,7 +2410,7 @@ __yy_memcpy (char *to, char *from, int count)
 #endif
 #endif
 \f
-#line 196 "/usr/share/bison.simple"
+#line 196 "/usr/share/misc/bison.simple"
 
 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
    into yyparse.  The argument should have type void *.
@@ -4675,7 +4675,7 @@ case 493:
     break;}
 }
    /* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/share/bison.simple"
+#line 498 "/usr/share/misc/bison.simple"
 \f
   yyvsp -= yylen;
   yyssp -= yylen;
@@ -7620,15 +7620,16 @@ read_import_dir (wfl)
                }
              *filename->ptr++ = '/';
 
-             for (; k < zipf->count;  k++, zipd = ZIPDIR_NEXT (zipd))
+             for (k = 0; k < zipf->count;  k++, zipd = ZIPDIR_NEXT (zipd))
                {
                  char *current_entry = ZIPDIR_FILENAME (zipd);
                  int current_entry_len = zipd->filename_length;
 
-                 if (strncmp (filename->data, current_entry, 
-                              BUFFER_LENGTH (filename)) != 0)
+                 if (current_entry_len >= BUFFER_LENGTH (filename)
+                     && strncmp (filename->data, current_entry, 
+                                 BUFFER_LENGTH (filename)) != 0)
                    continue;
-                 found += note_possible_classname (current_entry,
+                 found |= note_possible_classname (current_entry,
                                                    current_entry_len);
                }
            }
@@ -7661,7 +7662,7 @@ read_import_dir (wfl)
              len = strlen (direntp->d_name);
              buffer_grow (filename, len+1);
              strcpy (filename->ptr, d_name);
-             found += note_possible_classname (filename->data + entry_length,
+             found |= note_possible_classname (filename->data + entry_length,
                                                package_length+len+1);
            }
          if (dirp)
index 8964e450fdab284c9c17eeff701f1c34c997abdb..504d1dc93aeadea9e036fe9fa5ba7344b49efb5e 100644 (file)
@@ -5018,15 +5018,16 @@ read_import_dir (wfl)
                }
              *filename->ptr++ = '/';
 
-             for (; k < zipf->count;  k++, zipd = ZIPDIR_NEXT (zipd))
+             for (k = 0; k < zipf->count;  k++, zipd = ZIPDIR_NEXT (zipd))
                {
                  char *current_entry = ZIPDIR_FILENAME (zipd);
                  int current_entry_len = zipd->filename_length;
 
-                 if (strncmp (filename->data, current_entry, 
-                              BUFFER_LENGTH (filename)) != 0)
+                 if (current_entry_len >= BUFFER_LENGTH (filename)
+                     && strncmp (filename->data, current_entry, 
+                                 BUFFER_LENGTH (filename)) != 0)
                    continue;
-                 found += note_possible_classname (current_entry,
+                 found |= note_possible_classname (current_entry,
                                                    current_entry_len);
                }
            }
@@ -5059,7 +5060,7 @@ read_import_dir (wfl)
              len = strlen (direntp->d_name);
              buffer_grow (filename, len+1);
              strcpy (filename->ptr, d_name);
-             found += note_possible_classname (filename->data + entry_length,
+             found |= note_possible_classname (filename->data + entry_length,
                                                package_length+len+1);
            }
          if (dirp)