diff options
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.73 2006/05/08 20:14:16 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.74 2006/06/22 16:12:59 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 | */ |
@@ -280,7 +280,7 @@ static int read_line (lua_State *L, FILE *f) { | |||
280 | char *p = luaL_prepbuffer(&b); | 280 | char *p = luaL_prepbuffer(&b); |
281 | if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ | 281 | if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ |
282 | luaL_pushresult(&b); /* close buffer */ | 282 | luaL_pushresult(&b); /* close buffer */ |
283 | return (lua_strlen(L, -1) > 0); /* check whether read something */ | 283 | return (lua_objlen(L, -1) > 0); /* check whether read something */ |
284 | } | 284 | } |
285 | l = strlen(p); | 285 | l = strlen(p); |
286 | if (l == 0 || p[l-1] != '\n') | 286 | if (l == 0 || p[l-1] != '\n') |
@@ -308,7 +308,7 @@ static int read_chars (lua_State *L, FILE *f, size_t n) { | |||
308 | n -= nr; /* still have to read `n' chars */ | 308 | n -= nr; /* still have to read `n' chars */ |
309 | } while (n > 0 && nr == rlen); /* until end of count or eof */ | 309 | } while (n > 0 && nr == rlen); /* until end of count or eof */ |
310 | luaL_pushresult(&b); /* close buffer */ | 310 | luaL_pushresult(&b); /* close buffer */ |
311 | return (n == 0 || lua_strlen(L, -1) > 0); | 311 | return (n == 0 || lua_objlen(L, -1) > 0); |
312 | } | 312 | } |
313 | 313 | ||
314 | 314 | ||