diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-09-18 11:03:18 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-09-18 11:03:18 -0300 |
commit | d22526ec30c32f7ed422d2cd63d4b5c426769597 (patch) | |
tree | f49002e0365ec2e33b18abaad9c853af2eee05b9 /liolib.c | |
parent | bd869c7b3147c277a974c896a5e3a013979ac64e (diff) | |
download | lua-d22526ec30c32f7ed422d2cd63d4b5c426769597.tar.gz lua-d22526ec30c32f7ed422d2cd63d4b5c426769597.tar.bz2 lua-d22526ec30c32f7ed422d2cd63d4b5c426769597.zip |
'lua_strlen' is for compatibility only
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 | ||