summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorragge <ragge>2008-08-18 14:09:33 +0000
committerragge <ragge>2008-08-18 14:09:33 +0000
commit6119f24fb84d991d1a2e78ccc90212315188e2d8 (patch)
tree87157910dbe2fdd788ed7346f36156158731636a
parent536515b0de0b07646c37827c0ed3f6ef5ee6f702 (diff)
Fix bug where stray non-alphanumeric character after # would cause
cpp to fail. Bug reported by Artur Grabowski.
-rw-r--r--scanner.l9
1 files changed, 9 insertions, 0 deletions
diff --git a/scanner.l b/scanner.l
index fc4b26c..75853fd 100644
--- a/scanner.l
+++ b/scanner.l
@@ -318,6 +318,14 @@ L?\"(\\.|[^\\"])*\" { PRTOUT(STRING); }
}
. {
+ if (contr) {
+ while (input() != '\n')
+ ;
+ unput('\n');
+ BEGIN 0;
+ contr = 0;
+ goto yy;
+ }
if (YYSTATE || slow)
return yytext[0];
if (yytext[0] == 6) { /* PRAGS */
@@ -332,6 +340,7 @@ L?\"(\\.|[^\\"])*\" { PRTOUT(STRING); }
} else {
PRTOUT(yytext[0]);
}
+ yy:;
}
%%