diff options
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.83 2009/11/24 12:05:44 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.84 2009/12/17 13:08:51 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -336,7 +336,7 @@ static int read_line (lua_State *L, FILE *f) { | |||
336 | char *p = luaL_prepbuffer(&b); | 336 | char *p = luaL_prepbuffer(&b); |
337 | if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ | 337 | if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ |
338 | luaL_pushresult(&b); /* close buffer */ | 338 | luaL_pushresult(&b); /* close buffer */ |
339 | return (lua_objlen(L, -1) > 0); /* check whether read something */ | 339 | return (lua_rawlen(L, -1) > 0); /* check whether read something */ |
340 | } | 340 | } |
341 | l = strlen(p); | 341 | l = strlen(p); |
342 | if (l == 0 || p[l-1] != '\n') | 342 | if (l == 0 || p[l-1] != '\n') |