diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-09-09 11:11:11 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-09-09 11:11:11 -0300 |
commit | f0cc2d55067d32c1232d9483721254360d4c3bae (patch) | |
tree | 3aff379cd171fdf2b4406cdd9bce1b466661f395 /inout.c | |
parent | d289ac81d3629f8dc494a11929d16f03accd1007 (diff) | |
download | lua-f0cc2d55067d32c1232d9483721254360d4c3bae.tar.gz lua-f0cc2d55067d32c1232d9483721254360d4c3bae.tar.bz2 lua-f0cc2d55067d32c1232d9483721254360d4c3bae.zip |
BUG: a program ending in a comment without EOL made lex loops forever.
Diffstat (limited to 'inout.c')
-rw-r--r-- | inout.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -5,7 +5,7 @@ | |||
5 | ** Also provides some predefined lua functions. | 5 | ** Also provides some predefined lua functions. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | char *rcs_inout="$Id: inout.c,v 2.37 1996/05/28 21:07:32 roberto Exp $"; | 8 | char *rcs_inout="$Id: inout.c,v 2.38 1996/07/12 20:00:26 roberto Exp roberto $"; |
9 | 9 | ||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | 11 | ||
@@ -31,7 +31,8 @@ static char *st; | |||
31 | */ | 31 | */ |
32 | static int fileinput (void) | 32 | static int fileinput (void) |
33 | { | 33 | { |
34 | return fgetc (fp); | 34 | int c = fgetc(fp); |
35 | return (c == EOF) ? 0 : c; | ||
35 | } | 36 | } |
36 | 37 | ||
37 | /* | 38 | /* |