diff --git a/ChangeLog b/ChangeLog index 7ca2df355..b9dc3a1e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-07-01 Robert Larice + * src/xspice/cmpp/mod_lex.l : + minor bug fix, use EOF + 2011-07-01 Robert Larice * src/frontend/help/textdisp.c : textdisp.c, minor rewrite to swallow type conversion warnings diff --git a/src/xspice/cmpp/mod_lex.l b/src/xspice/cmpp/mod_lex.l index 1c438095b..b31b9c0e7 100755 --- a/src/xspice/cmpp/mod_lex.l +++ b/src/xspice/cmpp/mod_lex.l @@ -52,7 +52,7 @@ Z [0-9A-Za-z_] %% -"/*" {char ch, last_ch; +"/*" {int ch, last_ch; ECHO; /* a comment - repeat it */ ch = '\0'; do { @@ -62,9 +62,14 @@ Z [0-9A-Za-z_] #else ch = input(); #endif + if(ch == EOF) { + mod_yyerror ("Unterminated comment"); + break; + } + fputc(ch,mod_yyout); - } while (ch && !((last_ch == '*') && (ch == '/'))); - if (!ch) {mod_yyerror ("Unterminated comment");}} + } while (!((last_ch == '*') && (ch == '/'))); + } ARGS {return TOK_ARGS;} INIT {return TOK_INIT;}