summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-31 11:44:46 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-31 11:44:46 +0000
commitd87202d0b6d6d82875aced43ae89b47a8a74f0d6 (patch)
tree52d08baf01725cba44bffca068fd1784e74f5feb /gcc
parent357e4bf9e743d06dda21c1f8c6b386c58c42943f (diff)
downloadppe42-gcc-d87202d0b6d6d82875aced43ae89b47a8a74f0d6.tar.gz
ppe42-gcc-d87202d0b6d6d82875aced43ae89b47a8a74f0d6.zip
* cccp.c (handle_directive): Handle backslash-newlines in quoted
strings correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27279 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cccp.c28
2 files changed, 30 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d0240839406..e83b9fe681e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Mon May 31 11:48:07 1999 Mark Mitchell <mark@codesourcery.com>
+
+ * cccp.c (handle_directive): Handle backslash-newlines in quoted
+ strings correctly.
+
Mon May 31 09:36:11 1999 Cort Dougan <cort@cs.nmt.edu>
* rs6000/linux.h (LINK_SPEC): Use emulation elf32ppclinux.
diff --git a/gcc/cccp.c b/gcc/cccp.c
index e89d00c574b..6e2d519f626 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -3981,11 +3981,33 @@ handle_directive (ip, op)
case '\'':
case '\"':
{
+ int backslash_newlines_p;
+
register U_CHAR *bp1
= skip_quoted_string (xp - 1, bp, ip->lineno,
- NULL_PTR, NULL_PTR, NULL_PTR);
- while (xp != bp1)
- *cp++ = *xp++;
+ NULL_PTR, &backslash_newlines_p,
+ NULL_PTR);
+ if (backslash_newlines_p)
+ while (xp != bp1)
+ {
+ /* With something like:
+
+ #define X "a\
+ b"
+
+ we should still remove the backslash-newline
+ pair as part of phase two. */
+ if (xp[0] == '\\' && xp[1] == '\n')
+ xp += 2;
+ else
+ *cp++ = *xp++;
+ }
+ else
+ /* This is the same as the loop above, but taking
+ advantage of the fact that we know there are no
+ backslash-newline pairs. */
+ while (xp != bp1)
+ *cp++ = *xp++;
}
break;
OpenPOWER on IntegriCloud