summaryrefslogtreecommitdiff
path: root/scan.l
diff options
context:
space:
mode:
authorVern Paxson <vern@ee.lbl.gov>1993-08-24 20:43:03 +0000
committerVern Paxson <vern@ee.lbl.gov>1993-08-24 20:43:03 +0000
commiteb4bc1e0cf3d9d7c8b8802bcac8909fb26758b2d (patch)
tree9512cee9c14830f6dbbebee71b39339b4bbc974e /scan.l
parent2b84ab9e5489f4df70d67c2a3b9fe6dfa433ed75 (diff)
Fixed bug with empty section 2
Diffstat (limited to 'scan.l')
-rw-r--r--scan.l10
1 files changed, 8 insertions, 2 deletions
diff --git a/scan.l b/scan.l
index fb2f465..9f0e8ca 100644
--- a/scan.l
+++ b/scan.l
@@ -213,7 +213,12 @@ CCL_CHAR [^\\\n\]]|{ESCSEQ}
<SECT2PROLOG>.*{NL} ++linenum; ACTION_ECHO;
-<SECT2PROLOG><<EOF>> MARK_END_OF_PROLOG; yyterminate();
+<SECT2PROLOG><<EOF>> {
+ MARK_END_OF_PROLOG;
+ sectnum = 3;
+ BEGIN(SECT3);
+ yyterminate(); /* to stop the parser */
+ }
<SECT2>^{OPTWS}{NL} ++linenum; /* allow blank lines in section 2 */
@@ -266,7 +271,7 @@ CCL_CHAR [^\\\n\]]|{ESCSEQ}
<SECT2>^"%%".* {
sectnum = 3;
BEGIN(SECT3);
- return EOF; /* to stop the parser */
+ yyterminate(); /* to stop the parser */
}
<SECT2>"["{FIRST_CCL_CHAR}{CCL_CHAR}* {
@@ -485,6 +490,7 @@ CCL_CHAR [^\\\n\]]|{ESCSEQ}
<SECT3>.*(\n?) ECHO;
+<SECT3><<EOF>> sectnum = 0; yyterminate();
<*>.|\n format_synerr( "bad character: %s", (char *) yytext );