mirror of https://github.com/rusefi/lua.git
"read" must return 'nil' on EOF.
This commit is contained in:
parent
3bb6443131
commit
0c3e0fd95d
7
iolib.c
7
iolib.c
|
@ -3,7 +3,7 @@
|
||||||
** Input/output library to LUA
|
** Input/output library to LUA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char *rcs_iolib="$Id: iolib.c,v 1.27 1995/11/03 15:43:50 roberto Exp roberto $";
|
char *rcs_iolib="$Id: iolib.c,v 1.28 1995/11/10 17:55:48 roberto Exp roberto $";
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -247,6 +247,11 @@ static void read_free (void)
|
||||||
int c;
|
int c;
|
||||||
while (isspace(c=fgetc(in)))
|
while (isspace(c=fgetc(in)))
|
||||||
;
|
;
|
||||||
|
if (c == EOF)
|
||||||
|
{
|
||||||
|
lua_pushnil();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (c == '\"' || c == '\'')
|
if (c == '\"' || c == '\'')
|
||||||
{ /* string */
|
{ /* string */
|
||||||
c = read_until_char(c);
|
c = read_until_char(c);
|
||||||
|
|
Loading…
Reference in New Issue