lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 7f69f0efb07d54bfb9d91ed426d2774a703be5ab
parent f6cab9666c90794596c0d1b3fa6ab86f94ab2f83
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Tue, 12 Feb 2008 14:50:40 -0200

remove of useless test in 'read_chars' (if n == 0 then the resulting
string cannot be empty).

Diffstat:
Mliolib.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/liolib.c b/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.76 2007/04/19 20:22:32 roberto Exp roberto $ +** $Id: liolib.c,v 2.77 2007/12/08 11:54:32 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -323,7 +323,7 @@ static int read_chars (lua_State *L, FILE *f, size_t n) { n -= nr; /* still have to read `n' chars */ } while (n > 0 && nr == rlen); /* until end of count or eof */ luaL_pushresult(&b); /* close buffer */ - return (n == 0 || lua_objlen(L, -1) > 0); + return (lua_objlen(L, -1) > 0); }