From 27f7bd2e8301213d1b84eecad5c3e5cee35b24eb Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 1 Oct 2014 13:05:06 -0300 Subject: [PATCH] detail --- liolib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/liolib.c b/liolib.c index b5f7af7b..8a81dd57 100644 --- a/liolib.c +++ b/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.128 2014/07/29 16:01:00 roberto Exp roberto $ +** $Id: liolib.c,v 2.129 2014/09/26 14:09:21 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -581,7 +581,7 @@ static int io_readline (lua_State *L) { lua_pushvalue(L, lua_upvalueindex(3 + i)); n = g_read(L, p->f, 2); /* 'n' is number of results */ lua_assert(n > 0); /* should return at least a nil */ - if (!lua_isnil(L, -n)) /* read at least one value? */ + if (lua_toboolean(L, -n)) /* read at least one value? */ return n; /* return them */ else { /* first result is nil: EOF or error */ if (n > 1) { /* is there error information? */