aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-11-10 16:32:59 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-11-10 16:32:59 -0200
commit0c3e0fd95d4375da18917563b14252e1700bd3bb (patch)
tree2b84e2c7ba077a65fa594756d1b33edbc4fef8d2
parent3bb6443131da2285b2311f258dfe37a3dcd38a5f (diff)
downloadlua-0c3e0fd95d4375da18917563b14252e1700bd3bb.tar.gz
lua-0c3e0fd95d4375da18917563b14252e1700bd3bb.tar.bz2
lua-0c3e0fd95d4375da18917563b14252e1700bd3bb.zip
"read" must return 'nil' on EOF.
-rw-r--r--iolib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/iolib.c b/iolib.c
index 656c1b5b..37ad50ce 100644
--- a/iolib.c
+++ b/iolib.c
@@ -3,7 +3,7 @@
3** Input/output library to LUA 3** Input/output library to LUA
4*/ 4*/
5 5
6char *rcs_iolib="$Id: iolib.c,v 1.27 1995/11/03 15:43:50 roberto Exp roberto $"; 6char *rcs_iolib="$Id: iolib.c,v 1.28 1995/11/10 17:55:48 roberto Exp roberto $";
7 7
8#include <stdio.h> 8#include <stdio.h>
9#include <ctype.h> 9#include <ctype.h>
@@ -247,6 +247,11 @@ static void read_free (void)
247 int c; 247 int c;
248 while (isspace(c=fgetc(in))) 248 while (isspace(c=fgetc(in)))
249 ; 249 ;
250 if (c == EOF)
251 {
252 lua_pushnil();
253 return;
254 }
250 if (c == '\"' || c == '\'') 255 if (c == '\"' || c == '\'')
251 { /* string */ 256 { /* string */
252 c = read_until_char(c); 257 c = read_until_char(c);