summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorragge <ragge>2009-08-09 14:41:49 +0000
committerragge <ragge>2009-08-09 14:41:49 +0000
commit6d3bedfde1f54844946cca359b42c1fe14dfdd19 (patch)
treecb1306bcd3cf5a3eaa8e4ff83eba270fbe1288cd
parent8d3d9abfd51b04c80fc8cd9c62e9938e96920b5e (diff)
Line endings with \ were not concatenated to next line iside strings.
Bug spotted by Jonathan Gray.
-rw-r--r--token.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/token.c b/token.c
index 383c764..65a98cf 100644
--- a/token.c
+++ b/token.c
@@ -218,10 +218,10 @@ run: ch = NXTCH();
case '\"': /* strings */
str: PUTCH(ch);
- while ((ch = NXTCH()) != '\"') {
+ while ((ch = inch()) != '\"') {
PUTCH(ch);
if (ch == '\\') {
- ch = NXTCH();
+ ch = inch();
PUTCH(ch);
}
if (ch < 0)
@@ -604,7 +604,6 @@ again: switch (c = inpch()) {
case '\\': /* continued lines */
msdos: if ((c = inpch()) == '\n') {
ifiles->lineno++;
- putch('\n');
goto again;
} else if (c == '\r')
goto msdos;