From 4284b774e6f846f1fe69479a6246a3bcfd6c3641 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Mon, 5 Oct 1998 00:03:35 +0000 Subject: [PATCH] cpplib.c (macroexpand): Correct off-by-one error in handling of escapes. * cpplib.c (macroexpand): Correct off-by-one error in handling of escapes. From-SVN: r22827 --- gcc/ChangeLog | 5 +++++ gcc/cpplib.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7184fe45bda..929c4b14547 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 5 01:01:42 1998 Zack Weinberg + + * cpplib.c (macroexpand): Correct off-by-one error in handling + of escapes. + Sun Oct 4 23:58:30 1998 Richard Henderson * combine.c (expand_field_assignment): Don't do bitwise operations diff --git a/gcc/cpplib.c b/gcc/cpplib.c index b37a779819c..874a1759a50 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -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;