mirror of https://github.com/rusefi/lua.git
details
This commit is contained in:
parent
7959f3aebb
commit
9b45439860
4
lgc.c
4
lgc.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lgc.c,v 1.79 2001/01/25 16:45:36 roberto Exp roberto $
|
** $Id: lgc.c,v 1.80 2001/01/26 13:18:00 roberto Exp roberto $
|
||||||
** Garbage Collector
|
** Garbage Collector
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -253,7 +253,7 @@ static void collecttable (lua_State *L) {
|
||||||
|
|
||||||
|
|
||||||
static void checktab (lua_State *L, stringtable *tb) {
|
static void checktab (lua_State *L, stringtable *tb) {
|
||||||
if (tb->nuse < (luint32)(tb->size/4) && tb->size > 10)
|
if (tb->nuse < (luint32)(tb->size/4) && tb->size > MINPOWER2)
|
||||||
luaS_resize(L, tb, tb->size/2); /* table is too big */
|
luaS_resize(L, tb, tb->size/2); /* table is too big */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
liolib.c
14
liolib.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: liolib.c,v 1.100 2001/01/25 16:45:36 roberto Exp roberto $
|
** $Id: liolib.c,v 1.101 2001/01/26 11:45:51 roberto Exp roberto $
|
||||||
** Standard I/O (and system) library
|
** Standard I/O (and system) library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -306,14 +306,12 @@ static int io_read (lua_State *L) {
|
||||||
luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments");
|
luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments");
|
||||||
success = 1;
|
success = 1;
|
||||||
for (n = 1; n<=nargs && success; n++) {
|
for (n = 1; n<=nargs && success; n++) {
|
||||||
const char *p = luaL_check_string(L, n);
|
if (lua_type(L, n) == LUA_TNUMBER)
|
||||||
if (p[0] != '*') {
|
success = read_chars(L, f, (size_t)lua_tonumber(L, n));
|
||||||
if (lua_isnumber(L, n))
|
|
||||||
success = read_chars(L, f, (size_t)lua_tonumber(L, n));
|
|
||||||
else
|
|
||||||
lua_error(L, "read patterns are deprecated");
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
|
const char *p = lua_tostring(L, n);
|
||||||
|
if (!p || p[0] != '*')
|
||||||
|
lua_error(L, "invalid `read' option");
|
||||||
switch (p[1]) {
|
switch (p[1]) {
|
||||||
case 'n': /* number */
|
case 'n': /* number */
|
||||||
success = read_number(L, f);
|
success = read_number(L, f);
|
||||||
|
|
Loading…
Reference in New Issue