aboutsummaryrefslogtreecommitdiff
path: root/inout.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-09-09 11:11:11 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-09-09 11:11:11 -0300
commitf0cc2d55067d32c1232d9483721254360d4c3bae (patch)
tree3aff379cd171fdf2b4406cdd9bce1b466661f395 /inout.c
parentd289ac81d3629f8dc494a11929d16f03accd1007 (diff)
downloadlua-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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/inout.c b/inout.c
index 1d618596..237dd574 100644
--- a/inout.c
+++ b/inout.c
@@ -5,7 +5,7 @@
5** Also provides some predefined lua functions. 5** Also provides some predefined lua functions.
6*/ 6*/
7 7
8char *rcs_inout="$Id: inout.c,v 2.37 1996/05/28 21:07:32 roberto Exp $"; 8char *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*/
32static int fileinput (void) 32static 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/*