aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-26 12:16:24 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-26 12:16:24 -0200
commit9b45439860879dd282e6d0896c4ee8102febc7fd (patch)
treec92064323d07f78cde9e429f7799288b070d8b8c
parent7959f3aebb5b12f474b65429dedf550b28223e08 (diff)
downloadlua-9b45439860879dd282e6d0896c4ee8102febc7fd.tar.gz
lua-9b45439860879dd282e6d0896c4ee8102febc7fd.tar.bz2
lua-9b45439860879dd282e6d0896c4ee8102febc7fd.zip
details
-rw-r--r--lgc.c4
-rw-r--r--liolib.c14
2 files changed, 8 insertions, 10 deletions
diff --git a/lgc.c b/lgc.c
index 189adc6a..67fee0e2 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.79 2001/01/25 16:45:36 roberto Exp roberto $ 2** $Id: lgc.c,v 1.80 2001/01/26 13:18:00 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -253,7 +253,7 @@ static void collecttable (lua_State *L) {
253 253
254 254
255static void checktab (lua_State *L, stringtable *tb) { 255static void checktab (lua_State *L, stringtable *tb) {
256 if (tb->nuse < (luint32)(tb->size/4) && tb->size > 10) 256 if (tb->nuse < (luint32)(tb->size/4) && tb->size > MINPOWER2)
257 luaS_resize(L, tb, tb->size/2); /* table is too big */ 257 luaS_resize(L, tb, tb->size/2); /* table is too big */
258} 258}
259 259
diff --git a/liolib.c b/liolib.c
index e4851209..cb3325f0 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 1.100 2001/01/25 16:45:36 roberto Exp roberto $ 2** $Id: liolib.c,v 1.101 2001/01/26 11:45:51 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*/
@@ -306,14 +306,12 @@ static int io_read (lua_State *L) {
306 luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); 306 luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments");
307 success = 1; 307 success = 1;
308 for (n = 1; n<=nargs && success; n++) { 308 for (n = 1; n<=nargs && success; n++) {
309 const char *p = luaL_check_string(L, n); 309 if (lua_type(L, n) == LUA_TNUMBER)
310 if (p[0] != '*') { 310 success = read_chars(L, f, (size_t)lua_tonumber(L, n));
311 if (lua_isnumber(L, n))
312 success = read_chars(L, f, (size_t)lua_tonumber(L, n));
313 else
314 lua_error(L, "read patterns are deprecated");
315 }
316 else { 311 else {
312 const char *p = lua_tostring(L, n);
313 if (!p || p[0] != '*')
314 lua_error(L, "invalid `read' option");
317 switch (p[1]) { 315 switch (p[1]) {
318 case 'n': /* number */ 316 case 'n': /* number */
319 success = read_number(L, f); 317 success = read_number(L, f);