From 9d28e2b3e5bb7efe02358e2bbb730d732af69edf Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 19 Apr 2010 15:04:58 -0300 Subject: [PATCH] bug with io.read(op, "*n") --- bugs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bugs b/bugs index 430c8f7a..c2fd3ecd 100644 --- a/bugs +++ b/bugs @@ -1880,8 +1880,8 @@ patch = [[ +++ lundump.c 2008/04/04 19:51:41 2.7.1.4 @@ -1,5 +1,5 @@ /* --** $Id: bugs,v 1.105 2009/11/23 14:59:30 roberto Exp roberto $ -+** $Id: bugs,v 1.105 2009/11/23 14:59:30 roberto Exp roberto $ +-** $Id: bugs,v 1.106 2010/04/19 16:39:25 roberto Exp roberto $ ++** $Id: bugs,v 1.106 2010/04/19 16:39:25 roberto Exp roberto $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -2265,7 +2265,17 @@ since = [[5.0]], example = [[ x = string.rep("x", 10000) .. "%d" print(string.format(x)) -- gives wrong error message -patch = [[ -]] +patch = nil +} + +Bug{ +what = [['io.read(op, "*n")' may return garbage if second read fails]], +report = [[Roberto I., 2010/04/12]], +since = [[5.0]], +example = [[ +print(io.read("*n", "*n") --<< enter "10 hi" +--> file (0x884420) nil +]], +patch = nil }