summaryrefslogtreecommitdiff
path: root/src/liolib.c
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2006-02-07 12:00:00 +0000
committerrepogen <>2006-02-07 12:00:00 +0000
commit43fb64048e381a76d6cd363dedd9ccc8a85b9b31 (patch)
tree98ca9eb0375499f20a4ca13d2cbbc4451f6e9477 /src/liolib.c
parentb487a3dce43e449acf3852ec56345e2860cfeab7 (diff)
downloadlua-github-5.1-rc3.tar.gz
Lua 5.1-rc35.1-rc3
Diffstat (limited to 'src/liolib.c')
-rw-r--r--src/liolib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liolib.c b/src/liolib.c
index fd7894c9..bb3b5194 100644
--- a/src/liolib.c
+++ b/src/liolib.c
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.71 2006/01/17 13:54:02 roberto Exp $
+** $Id: liolib.c,v 2.72 2006/01/28 12:59:13 roberto Exp $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -283,7 +283,7 @@ static int read_line (lua_State *L, FILE *f) {
return (lua_strlen(L, -1) > 0); /* check whether read something */
}
l = strlen(p);
- if (p[l-1] != '\n')
+ if (l == 0 || p[l-1] != '\n')
luaL_addsize(&b, l);
else {
luaL_addsize(&b, l - 1); /* do not include `eol' */