cpplib.c (macroexpand): Correct off-by-one error in handling of escapes.
authorZack Weinberg <zack@rabi.phys.columbia.edu>
Mon, 5 Oct 1998 00:03:35 +0000 (00:03 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 5 Oct 1998 00:03:35 +0000 (18:03 -0600)
        * cpplib.c (macroexpand): Correct off-by-one error in handling
        of escapes.

From-SVN: r22827

gcc/ChangeLog
gcc/cpplib.c

index 7184fe45bdae224e99aeb42bb61ba7358d94a366..929c4b14547c5afa045f9b766e08fbc8a87435d5 100644 (file)
@@ -1,3 +1,8 @@
+Mon Oct  5 01:01:42 1998  Zack Weinberg  <zack@rabi.phys.columbia.edu>  
+
+       * cpplib.c (macroexpand): Correct off-by-one error in handling
+       of escapes.
+
 Sun Oct  4 23:58:30 1998  Richard Henderson  <rth@cygnus.com>
 
        * combine.c (expand_field_assignment): Don't do bitwise operations
index b37a779819cc1a0b3d613bde7185f5cc6d9abbd6..874a1759a501c4d3e6032fe17236edaeb5b3cb1f 100644 (file)
@@ -2888,8 +2888,8 @@ macroexpand (pfile, hp)
                          /* If whitespace is preceded by an odd number
                             of `@' signs, the last `@' was a whitespace
                             marker; drop it too. */
-                         while (p2 != p1 && p2[-1] == '@') p2--;
-                         if ((l1 - 1 - p2) & 1)
+                         while (p2 != p1 && p2[0] == '@') p2--;
+                         if ((l1 - p2) & 1)
                            l1--;
                          break;
                        }
@@ -2899,8 +2899,8 @@ macroexpand (pfile, hp)
                          /* If a `-' is preceded by an odd number of
                             `@' signs then it and the last `@' are
                             a no-reexpansion marker.  */
-                         while (p2 != p1 && p2[-1] == '@') p2--;
-                         if ((l1 - 1 - p2) & 1)
+                         while (p2 != p1 && p2[0] == '@') p2--;
+                         if ((l1 - p2) & 1)
                            l1 -= 2;
                          else
                            break;