mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
yacc: Fix a bug from at least 1995.
Fix a bug folding newlines in strings constants in C code snippets in YACC. This code has existed since at least 2nd Edition Plan 9. Change-Id: Iba17b89a6529ac9fa6610bf0b44f551904174c26 Signed-off-by: Dan Cross <cross@gajendra.net> Reviewed-on: https://plan9port-review.googlesource.com/2840 Reviewed-by: Russ Cox <rsc@swtch.com>
This commit is contained in:
parent
94b38bdb72
commit
9e52ea8a29
1 changed files with 2 additions and 1 deletions
|
@ -2130,11 +2130,12 @@ swt:
|
|||
c = Bgetrune(finput);
|
||||
if(c == '\n')
|
||||
lineno++;
|
||||
} else
|
||||
} else {
|
||||
if(c == match)
|
||||
goto lcopy;
|
||||
if(c == '\n')
|
||||
error("newline in string or char. const.");
|
||||
}
|
||||
Bputrune(faction, c);
|
||||
}
|
||||
error("EOF in string or character constant");
|
||||
|
|
Loading…
Reference in a new issue