2000-02-07 Zack Weinberg <zack@wolery.cumb.org>
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Feb 2000 18:34:05 +0000 (18:34 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Feb 2000 18:34:05 +0000 (18:34 +0000)
* cppfiles.c (deps_output): Count spacers in deps_column.

2000-02-07  Neil Booth  <NeilB@earthling.net>

* cppinit.c (initialize_dependency_output): If there is no
suffix, don't try to look for known suffixes.  Use strrchr.
(cpp_start_read): Remove duplicate initialization.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31832 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cppfiles.c
gcc/cppinit.c

index fbfe968..438faba 100644 (file)
@@ -1,3 +1,13 @@
+2000-02-07  Zack Weinberg  <zack@wolery.cumb.org>
+
+       * cppfiles.c (deps_output): Count spacers in deps_column.
+
+2000-02-07  Neil Booth  <NeilB@earthling.net>
+
+       * cppinit.c (initialize_dependency_output): If there is no
+       suffix, don't try to look for known suffixes.  Use strrchr.
+       (cpp_start_read): Remove duplicate initialization.
+
 Mon Feb  7 18:36:41 MET 2000  Jan Hubicka  <jh@suse.cz>
 
        * calls.c (compute_argument_block_size): New argument
index c5e1b18..8bc313d 100644 (file)
@@ -1214,7 +1214,7 @@ deps_output (pfile, string, spacer)
     pfile->deps_buffer[pfile->deps_size++] = ' ';
   bcopy (string, &pfile->deps_buffer[pfile->deps_size], size);
   pfile->deps_size += size;
-  pfile->deps_column += size;
+  pfile->deps_column += size + 1;  /* count spacer too */
   if (spacer == ':')
     pfile->deps_buffer[pfile->deps_size++] = ':';
   pfile->deps_buffer[pfile->deps_size] = 0;
index 6bc567c..102e815 100644 (file)
@@ -636,10 +636,10 @@ initialize_dependency_output (pfile)
       /* Output P, but remove known suffixes.  */
       q = p + len;
       /* Point to the filename suffix.  */
-      r = rindex (p, '.');
-      /* Compare against the known suffixes.  */
-      for (x = 0; known_suffixes[x]; x++)
-       {
+      r = strrchr (p, '.');
+      if (r)
+       /* Compare against the known suffixes.  */
+       for (x = 0; known_suffixes[x]; x++)
          if (strncmp (known_suffixes[x], r, q - r) == 0)
            {
              /* Make q point to the bit we're going to overwrite
@@ -647,7 +647,6 @@ initialize_dependency_output (pfile)
              q = r;
              break;
            }
-       }
 
       /* Supply our own suffix.  */
       strcpy (q, OBJECT_SUFFIX);
@@ -804,7 +803,6 @@ cpp_start_read (pfile, fname)
          int default_len = sizeof GCC_INCLUDE_DIR - 8;
          int specd_len = strlen (specd_prefix);
 
-         default_len = sizeof GCC_INCLUDE_DIR - 8;
          memcpy (default_prefix, GCC_INCLUDE_DIR, default_len);
          default_prefix[default_len] = '\0';