summaryrefslogtreecommitdiff
path: root/scan.l
diff options
context:
space:
mode:
authorVern Paxson <vern@ee.lbl.gov>1990-03-20 11:36:04 +0000
committerVern Paxson <vern@ee.lbl.gov>1990-03-20 11:36:04 +0000
commit58d7f1822a723d8b0980c0d31eeacbd8501ea1cf (patch)
tree6049cc6577a8d8ba4a4c07c9a9adaf7c2b1a9479 /scan.l
parentfc25bea0a9caae2cf9bcbe36591fb51bf2062aaa (diff)
Removed malloc() declaration.
Added detection of EOF in actions.
Diffstat (limited to 'scan.l')
-rw-r--r--scan.l7
1 files changed, 5 insertions, 2 deletions
diff --git a/scan.l b/scan.l
index ee9a2be..922f0d2 100644
--- a/scan.l
+++ b/scan.l
@@ -132,8 +132,6 @@ ESCSEQ \\([^\n]|[0-9]{1,3}|x[0-9a-f]{1,2})
^"%"[cr]{OPTWS} /* ignore old lex directive */
%t{OPTWS}\n {
- char *malloc();
-
++linenum;
xlation = (int *) malloc( sizeof( int ) * csize );
@@ -476,6 +474,11 @@ ESCSEQ \\([^\n]|[0-9]{1,3}|x[0-9a-f]{1,2})
<ACTION_STRING>\" ACTION_ECHO; BEGIN(ACTION);
<ACTION_STRING>. ACTION_ECHO;
+<ACTION,ACTION_COMMENT,ACTION_STRING><<EOF>> {
+ synerr( "EOF encountered inside an action" );
+ yyterminate();
+ }
+
<SECT2,QUOTE,CCL>{ESCSEQ} {
yylval = myesc( yytext );