RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall
Root: /v/rpm/cvs Email: rse@rpm5.org
Module: xar rpm lua Date: 25-Jan-2008 17:54:34
Branch: HEAD Handle: 2008012516542806
Modified files:
lua lapi.c lapi.h lauxlib.c lauxlib.h lbaselib.c
lcode.c lcode.h ldblib.c ldebug.c ldebug.h ldo.c
ldo.h ldump.c lfunc.c lfunc.h lgc.c lgc.h linit.c
liolib.c llex.c llex.h llimits.h lmathlib.c lmem.c
lmem.h loadlib.c lobject.c lobject.h lopcodes.c
lopcodes.h loslib.c lparser.c lparser.h lstate.c
lstate.h lstring.c lstring.h lstrlib.c ltable.c
ltable.h ltablib.c ltm.c ltm.h lua.c lua.h
luaconf.h lualib.h lundump.c lundump.h lvm.c lvm.h
lzio.c lzio.h
rpm CHANGES INSTALL devtool.conf
xar Makefile.in
Log:
upgrade from Lua 5.1.2 to Lua 5.1.3 (external and internal)
Summary:
Revision Changes Path
1.4 +7 -2 lua/lapi.c
1.4 +1 -1 lua/lapi.h
1.2 +6 -7 lua/lauxlib.c
1.2 +1 -1 lua/lauxlib.h
1.2 +43 -35 lua/lbaselib.c
1.5 +1 -1 lua/lcode.c
1.4 +1 -1 lua/lcode.h
1.2 +15 -15 lua/ldblib.c
1.5 +1 -1 lua/ldebug.c
1.4 +1 -1 lua/ldebug.h
1.5 +13 -11 lua/ldo.c
1.4 +1 -1 lua/ldo.h
1.4 +1 -1 lua/ldump.c
1.3 +1 -1 lua/lfunc.c
1.4 +1 -1 lua/lfunc.h
1.5 +1 -1 lua/lgc.c
1.5 +1 -1 lua/lgc.h
1.2 +1 -1 lua/linit.c
1.2 +45 -24 lua/liolib.c
1.4 +1 -1 lua/llex.c
1.4 +1 -1 lua/llex.h
1.3 +1 -1 lua/llimits.h
1.2 +1 -1 lua/lmathlib.c
1.3 +1 -1 lua/lmem.c
1.4 +1 -1 lua/lmem.h
1.2 +1 -1 lua/loadlib.c
1.4 +1 -1 lua/lobject.c
1.4 +1 -1 lua/lobject.h
1.3 +1 -1 lua/lopcodes.c
1.4 +1 -1 lua/lopcodes.h
1.2 +1 -2 lua/loslib.c
1.6 +2 -2 lua/lparser.c
1.4 +1 -1 lua/lparser.h
1.4 +3 -3 lua/lstate.c
1.4 +2 -1 lua/lstate.h
1.4 +1 -1 lua/lstring.c
1.4 +1 -1 lua/lstring.h
1.2 +5 -5 lua/lstrlib.c
1.5 +1 -1 lua/ltable.c
1.4 +1 -1 lua/ltable.h
1.2 +3 -2 lua/ltablib.c
1.4 +1 -1 lua/ltm.c
1.4 +1 -1 lua/ltm.h
1.2 +4 -2 lua/lua.c
1.2 +7 -4 lua/lua.h
1.2 +4 -3 lua/luaconf.h
1.2 +1 -1 lua/lualib.h
1.4 +4 -2 lua/lundump.c
1.4 +1 -1 lua/lundump.h
1.6 +1 -1 lua/lvm.c
1.4 +1 -1 lua/lvm.h
1.3 +1 -1 lua/lzio.c
1.4 +1 -1 lua/lzio.h
1.2094 +1 -0 rpm/CHANGES
2.75 +1 -1 rpm/INSTALL
2.177 +1 -1 rpm/devtool.conf
1.5 +6 -4 xar/Makefile.in
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: lua/lapi.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 lapi.c
--- lua/lapi.c 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/lapi.c 25 Jan 2008 16:54:29 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lapi.c,v 2.55 2006/06/07 12:37:17 roberto Exp $
+** $Id: lapi.c,v 2.55.1.3 2008/01/03 15:20:39 roberto Exp $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -123,6 +123,11 @@
}
+LUA_API void lua_setlevel (lua_State *from, lua_State *to) {
+ to->nCcalls = from->nCcalls;
+}
+
+
LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {
lua_CFunction old;
lua_lock(L);
@@ -749,7 +754,7 @@
res = 0;
break;
}
- luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1));
+ if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1));
L->top--;
lua_unlock(L);
return res;
@@ .
patch -p0 <<'@@ .'
Index: lua/lapi.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lapi.h
--- lua/lapi.h 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/lapi.h 25 Jan 2008 16:54:29 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lapi.h,v 2.2 2005/04/25 19:24:10 roberto Exp $
+** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions from Lua API
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lauxlib.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 lauxlib.c
--- lua/lauxlib.c 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/lauxlib.c 25 Jan 2008 16:54:29 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: lauxlib.c,v 1.159 2006/03/21 19:31:09 roberto Exp $
+** $Id: lauxlib.c,v 1.159.1.3 2008/01/21 13:20:51 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -244,7 +244,7 @@
if (libname) {
int size = libsize(l);
/* check whether lib already exists */
- luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", size);
+ luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1);
lua_getfield(L, -1, libname); /* get _LOADED[libname] */
if (!lua_istable(L, -1)) { /* not found? */
lua_pop(L, 1); /* remove previous result */
@@ -535,7 +535,7 @@
return "\n";
}
if (feof(lf->f)) return NULL;
- *size = fread(lf->buff, 1, LUAL_BUFFERSIZE, lf->f);
+ *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f);
return (*size > 0) ? lf->buff : NULL;
}
@@ -570,9 +570,8 @@
while ((c = getc(lf.f)) != EOF && c != '\n') ; /* skip first line */
if (c == '\n') c = getc(lf.f);
}
- if (c == LUA_SIGNATURE[0] && lf.f != stdin) { /* binary file? */
- fclose(lf.f);
- lf.f = fopen(filename, "rb"); /* reopen in binary mode */
+ if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */
+ lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */
if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
/* skip eventual `#!...' */
while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
@@ -581,7 +580,7 @@
ungetc(c, lf.f);
status = lua_load(L, getF, &lf, lua_tostring(L, -1));
readstatus = ferror(lf.f);
- if (lf.f != stdin) fclose(lf.f); /* close file (even in case of errors) */
+ if (filename) fclose(lf.f); /* close file (even in case of errors) */
if (readstatus) {
lua_settop(L, fnameindex); /* ignore results from `lua_load' */
return errfile(L, "read", fnameindex);
@@ .
patch -p0 <<'@@ .'
Index: lua/lauxlib.h
============================================================================
$ cvs diff -u -r1.1 -r1.2 lauxlib.h
--- lua/lauxlib.h 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/lauxlib.h 25 Jan 2008 16:54:29 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: lauxlib.h,v 1.88 2006/04/12 20:31:15 roberto Exp $
+** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lbaselib.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 lbaselib.c
--- lua/lbaselib.c 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/lbaselib.c 25 Jan 2008 16:54:29 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: lbaselib.c,v 1.191a 2006/06/02 15:34:00 roberto Exp $
+** $Id: lbaselib.c,v 1.191.1.4 2008/01/20 13:53:22 roberto Exp $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -477,15 +477,52 @@
** =======================================================
*/
+#define CO_RUN 0 /* running */
+#define CO_SUS 1 /* suspended */
+#define CO_NOR 2 /* 'normal' (it resumed another coroutine) */
+#define CO_DEAD 3
+
+static const char *const statnames[] =
+ {"running", "suspended", "normal", "dead"};
+
+static int costatus (lua_State *L, lua_State *co) {
+ if (L == co) return CO_RUN;
+ switch (lua_status(co)) {
+ case LUA_YIELD:
+ return CO_SUS;
+ case 0: {
+ lua_Debug ar;
+ if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */
+ return CO_NOR; /* it is running */
+ else if (lua_gettop(co) == 0)
+ return CO_DEAD;
+ else
+ return CO_SUS; /* initial state */
+ }
+ default: /* some error occured */
+ return CO_DEAD;
+ }
+}
+
+
+static int luaB_costatus (lua_State *L) {
+ lua_State *co = lua_tothread(L, 1);
+ luaL_argcheck(L, co, 1, "coroutine expected");
+ lua_pushstring(L, statnames[costatus(L, co)]);
+ return 1;
+}
+
+
static int auxresume (lua_State *L, lua_State *co, int narg) {
- int status;
+ int status = costatus(L, co);
if (!lua_checkstack(co, narg))
luaL_error(L, "too many arguments to resume");
- if (lua_status(co) == 0 && lua_gettop(co) == 0) {
- lua_pushliteral(L, "cannot resume dead coroutine");
+ if (status != CO_SUS) {
+ lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]);
return -1; /* error flag */
}
lua_xmove(L, co, narg);
+ lua_setlevel(L, co);
status = lua_resume(co, narg);
if (status == 0 || status == LUA_YIELD) {
int nres = lua_gettop(co);
@@ -556,39 +593,10 @@
}
-static int luaB_costatus (lua_State *L) {
- lua_State *co = lua_tothread(L, 1);
- luaL_argcheck(L, co, 1, "coroutine expected");
- if (L == co) lua_pushliteral(L, "running");
- else {
- switch (lua_status(co)) {
- case LUA_YIELD:
- lua_pushliteral(L, "suspended");
- break;
- case 0: {
- lua_Debug ar;
- if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */
- lua_pushliteral(L, "normal"); /* it is running */
- else if (lua_gettop(co) == 0)
- lua_pushliteral(L, "dead");
- else
- lua_pushliteral(L, "suspended"); /* initial state */
- break;
- }
- default: /* some error occured */
- lua_pushliteral(L, "dead");
- break;
- }
- }
- return 1;
-}
-
-
static int luaB_corunning (lua_State *L) {
if (lua_pushthread(L))
- return 0; /* main thread is not a coroutine */
- else
- return 1;
+ lua_pushnil(L); /* main thread is not a coroutine */
+ return 1;
}
@@ .
patch -p0 <<'@@ .'
Index: lua/lcode.c
============================================================================
$ cvs diff -u -r1.4 -r1.5 lcode.c
--- lua/lcode.c 25 Aug 2007 08:15:10 -0000 1.4
+++ lua/lcode.c 25 Jan 2008 16:54:29 -0000 1.5
@@ -1,5 +1,5 @@
/*
-** $Id: lcode.c,v 1.3 2007/07/15 17:56:10 rse Exp $
+** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lcode.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lcode.h
--- lua/lcode.h 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/lcode.h 25 Jan 2008 16:54:29 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lcode.h,v 1.48 2006/03/21 19:28:03 roberto Exp $
+** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/ldblib.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 ldblib.c
--- lua/ldblib.c 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/ldblib.c 25 Jan 2008 16:54:29 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: ldblib.c,v 1.104 2005/12/29 15:32:11 roberto Exp $
+** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
@@ -255,24 +255,25 @@
static int db_sethook (lua_State *L) {
- int arg;
+ int arg, mask, count;
+ lua_Hook func;
lua_State *L1 = getthread(L, &arg);
if (lua_isnoneornil(L, arg+1)) {
lua_settop(L, arg+1);
- lua_sethook(L1, NULL, 0, 0); /* turn off hooks */
+ func = NULL; mask = 0; count = 0; /* turn off hooks */
}
else {
const char *smask = luaL_checkstring(L, arg+2);
- int count = luaL_optint(L, arg+3, 0);
luaL_checktype(L, arg+1, LUA_TFUNCTION);
- lua_sethook(L1, hookf, makemask(smask, count), count);
+ count = luaL_optint(L, arg+3, 0);
+ func = hookf; mask = makemask(smask, count);
}
- gethooktable(L1);
- lua_pushlightuserdata(L1, L1);
+ gethooktable(L);
+ lua_pushlightuserdata(L, L1);
lua_pushvalue(L, arg+1);
- lua_xmove(L, L1, 1);
- lua_rawset(L1, -3); /* set new hook */
- lua_pop(L1, 1); /* remove hook table */
+ lua_rawset(L, -3); /* set new hook */
+ lua_pop(L, 1); /* remove hook table */
+ lua_sethook(L1, func, mask, count); /* set hooks */
return 0;
}
@@ -286,11 +287,10 @@
if (hook != NULL && hook != hookf) /* external hook? */
lua_pushliteral(L, "external hook");
else {
- gethooktable(L1);
- lua_pushlightuserdata(L1, L1);
- lua_rawget(L1, -2); /* get hook */
- lua_remove(L1, -2); /* remove hook table */
- lua_xmove(L1, L, 1);
+ gethooktable(L);
+ lua_pushlightuserdata(L, L1);
+ lua_rawget(L, -2); /* get hook */
+ lua_remove(L, -2); /* remove hook table */
}
lua_pushstring(L, unmakemask(mask, buff));
lua_pushinteger(L, lua_gethookcount(L1));
@@ .
patch -p0 <<'@@ .'
Index: lua/ldebug.c
============================================================================
$ cvs diff -u -r1.4 -r1.5 ldebug.c
--- lua/ldebug.c 25 Aug 2007 08:15:10 -0000 1.4
+++ lua/ldebug.c 25 Jan 2008 16:54:29 -0000 1.5
@@ -1,5 +1,5 @@
/*
-** $Id: ldebug.c,v 1.3 2007/07/15 17:56:10 rse Exp $
+** $Id: ldebug.c,v 2.29.1.3 2007/12/28 15:32:23 roberto Exp $
** Debug Interface
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/ldebug.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 ldebug.h
--- lua/ldebug.h 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/ldebug.h 25 Jan 2008 16:54:29 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: ldebug.h,v 2.3 2005/04/25 19:24:10 roberto Exp $
+** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions from Debug Interface module
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/ldo.c
============================================================================
$ cvs diff -u -r1.4 -r1.5 ldo.c
--- lua/ldo.c 15 Jul 2007 17:56:10 -0000 1.4
+++ lua/ldo.c 25 Jan 2008 16:54:29 -0000 1.5
@@ -1,5 +1,5 @@
/*
-** $Id: ldo.c,v 2.38 2006/06/05 19:36:14 roberto Exp $
+** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ -83,7 +83,7 @@
L->base = L->ci->base;
luaF_close(L, L->base); /* close eventual pending closures */
luaD_seterrorobj(L, status, L->base);
- L->nCcalls = 0;
+ L->nCcalls = L->baseCcalls;
L->allowhook = 1;
restore_stack_limit(L);
L->errfunc = 0;
@@ -332,7 +332,7 @@
ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */
luaD_callhook(L, LUA_HOOKRET, -1);
if (f_isLua(L->ci)) { /* Lua function? */
- while (L->ci->tailcalls--) /* call hook for eventual tail calls */
+ while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */
luaD_callhook(L, LUA_HOOKTAILRET, -1);
}
return restorestack(L, fr);
@@ -417,22 +417,24 @@
LUA_API int lua_resume (lua_State *L, int nargs) {
int status;
lua_lock(L);
- if (L->status != LUA_YIELD) {
- if (L->status != 0)
- return resume_error(L, "cannot resume dead coroutine");
- else if (L->ci != L->base_ci)
+ if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci))
return resume_error(L, "cannot resume non-suspended coroutine");
- }
+ if (L->nCcalls >= LUAI_MAXCCALLS)
+ return resume_error(L, "C stack overflow");
luai_userstateresume(L, nargs);
- lua_assert(L->errfunc == 0 && L->nCcalls == 0);
+ lua_assert(L->errfunc == 0);
+ L->baseCcalls = ++L->nCcalls;
status = luaD_rawrunprotected(L, resume, L->top - nargs);
if (status != 0) { /* error? */
L->status = cast_byte(status); /* mark thread as `dead' */
luaD_seterrorobj(L, status, L->top);
L->ci->top = L->top;
}
- else
+ else {
+ lua_assert(L->nCcalls == L->baseCcalls);
status = L->status;
+ }
+ --L->nCcalls;
lua_unlock(L);
return status;
}
@@ -441,7 +443,7 @@
LUA_API int lua_yield (lua_State *L, int nresults) {
luai_userstateyield(L, nresults);
lua_lock(L);
- if (L->nCcalls > 0)
+ if (L->nCcalls > L->baseCcalls)
luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");
L->base = L->top - nresults; /* protect stack slots below */
L->status = LUA_YIELD;
@@ .
patch -p0 <<'@@ .'
Index: lua/ldo.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 ldo.h
--- lua/ldo.h 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/ldo.h 25 Jan 2008 16:54:29 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: ldo.h,v 2.7 2005/08/24 16:15:49 roberto Exp $
+** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/ldump.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 ldump.c
--- lua/ldump.c 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/ldump.c 25 Jan 2008 16:54:29 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: ldump.c,v 1.15 2006/02/16 15:53:49 lhf Exp $
+** $Id: ldump.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
** save precompiled Lua chunks
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lfunc.c
============================================================================
$ cvs diff -u -r1.2 -r1.3 lfunc.c
--- lua/lfunc.c 15 Jul 2007 17:56:10 -0000 1.2
+++ lua/lfunc.c 25 Jan 2008 16:54:29 -0000 1.3
@@ -1,5 +1,5 @@
/*
-** $Id: lfunc.c,v 2.12a 2005/12/22 16:19:56 roberto Exp $
+** $Id: lfunc.c,v 2.12.1.2 2007/12/28 14:58:43 roberto Exp $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lfunc.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lfunc.h
--- lua/lfunc.h 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/lfunc.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lfunc.h,v 2.4 2005/04/25 19:24:10 roberto Exp $
+** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lgc.c
============================================================================
$ cvs diff -u -r1.4 -r1.5 lgc.c
--- lua/lgc.c 15 Jul 2007 17:56:10 -0000 1.4
+++ lua/lgc.c 25 Jan 2008 16:54:30 -0000 1.5
@@ -1,5 +1,5 @@
/*
-** $Id: lgc.c,v 2.38 2006/05/24 14:34:06 roberto Exp $
+** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lgc.h
============================================================================
$ cvs diff -u -r1.4 -r1.5 lgc.h
--- lua/lgc.h 15 Jul 2007 17:56:10 -0000 1.4
+++ lua/lgc.h 25 Jan 2008 16:54:30 -0000 1.5
@@ -1,5 +1,5 @@
/*
-** $Id: lgc.h,v 2.15 2005/08/24 16:15:49 roberto Exp $
+** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/linit.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 linit.c
--- lua/linit.c 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/linit.c 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: linit.c,v 1.14 2005/12/29 15:32:11 roberto Exp $
+** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $
** Initialization of libraries for lua.c
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/liolib.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 liolib.c
--- lua/liolib.c 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/liolib.c 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.73 2006/05/08 20:14:16 roberto Exp $
+** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -51,7 +51,7 @@
}
-#define topfile(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE))
+#define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE))
static int io_type (lua_State *L) {
@@ -70,7 +70,7 @@
static FILE *tofile (lua_State *L) {
- FILE **f = topfile(L);
+ FILE **f = tofilep(L);
if (*f == NULL)
luaL_error(L, "attempt to use a closed file");
return *f;
@@ -93,19 +93,31 @@
/*
-** this function has a separated environment, which defines the
-** correct __close for 'popen' files
+** function to (not) close the standard files stdin, stdout, and stderr
+*/
+static int io_noclose (lua_State *L) {
+ lua_pushnil(L);
+ lua_pushliteral(L, "cannot close standard file");
+ return 2;
+}
+
+
+/*
+** function to close 'popen' files
*/
static int io_pclose (lua_State *L) {
- FILE **p = topfile(L);
+ FILE **p = tofilep(L);
int ok = lua_pclose(L, *p);
*p = NULL;
return pushresult(L, ok, NULL);
}
+/*
+** function to close regular files
+*/
static int io_fclose (lua_State *L) {
- FILE **p = topfile(L);
+ FILE **p = tofilep(L);
int ok = (fclose(*p) == 0);
*p = NULL;
return pushresult(L, ok, NULL);
@@ -128,18 +140,18 @@
static int io_gc (lua_State *L) {
- FILE *f = *topfile(L);
- /* ignore closed files and standard files */
- if (f != NULL && f != stdin && f != stdout && f != stderr)
+ FILE *f = *tofilep(L);
+ /* ignore closed files */
+ if (f != NULL)
aux_close(L);
return 0;
}
static int io_tostring (lua_State *L) {
- FILE *f = *topfile(L);
+ FILE *f = *tofilep(L);
if (f == NULL)
- lua_pushstring(L, "file (closed)");
+ lua_pushliteral(L, "file (closed)");
else
lua_pushfstring(L, "file (%p)", f);
return 1;
@@ -155,6 +167,10 @@
}
+/*
+** this function has a separated environment, which defines the
+** correct __close for 'popen' files
+*/
static int io_popen (lua_State *L) {
const char *filename = luaL_checkstring(L, 1);
const char *mode = luaL_optstring(L, 2, "r");
@@ -280,7 +296,7 @@
char *p = luaL_prepbuffer(&b);
if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */
luaL_pushresult(&b); /* close buffer */
- return (lua_strlen(L, -1) > 0); /* check whether read something */
+ return (lua_objlen(L, -1) > 0); /* check whether read something */
}
l = strlen(p);
if (l == 0 || p[l-1] != '\n')
@@ -308,7 +324,7 @@
n -= nr; /* still have to read `n' chars */
} while (n > 0 && nr == rlen); /* until end of count or eof */
luaL_pushresult(&b); /* close buffer */
- return (n == 0 || lua_strlen(L, -1) > 0);
+ return (n == 0 || lua_objlen(L, -1) > 0);
}
@@ -502,31 +518,36 @@
lua_pushvalue(L, -1);
lua_rawseti(L, LUA_ENVIRONINDEX, k);
}
- lua_setfield(L, -2, fname);
+ lua_pushvalue(L, -2); /* copy environment */
+ lua_setfenv(L, -2); /* set it */
+ lua_setfield(L, -3, fname);
+}
+
+
+static void newfenv (lua_State *L, lua_CFunction cls) {
+ lua_createtable(L, 0, 1);
+ lua_pushcfunction(L, cls);
+ lua_setfield(L, -2, "__close");
}
LUALIB_API int luaopen_io (lua_State *L) {
createmeta(L);
/* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */
- lua_createtable(L, 2, 1);
+ newfenv(L, io_fclose);
lua_replace(L, LUA_ENVIRONINDEX);
/* open library */
luaL_register(L, LUA_IOLIBNAME, iolib);
/* create (and set) default files */
+ newfenv(L, io_noclose); /* close function for default files */
createstdfile(L, stdin, IO_INPUT, "stdin");
createstdfile(L, stdout, IO_OUTPUT, "stdout");
createstdfile(L, stderr, 0, "stderr");
- /* create environment for 'popen' */
+ lua_pop(L, 1); /* pop environment for default files */
lua_getfield(L, -1, "popen");
- lua_createtable(L, 0, 1);
- lua_pushcfunction(L, io_pclose);
- lua_setfield(L, -2, "__close");
- lua_setfenv(L, -2);
+ newfenv(L, io_pclose); /* create environment for 'popen' */
+ lua_setfenv(L, -2); /* set fenv for 'popen' */
lua_pop(L, 1); /* pop 'popen' */
- /* set default close function */
- lua_pushcfunction(L, io_fclose);
- lua_setfield(L, LUA_ENVIRONINDEX, "__close");
return 1;
}
@@ .
patch -p0 <<'@@ .'
Index: lua/llex.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 llex.c
--- lua/llex.c 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/llex.c 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: llex.c,v 2.20 2006/03/09 18:14:31 roberto Exp $
+** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/llex.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 llex.h
--- lua/llex.h 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/llex.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: llex.h,v 1.58 2006/03/23 18:23:32 roberto Exp $
+** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/llimits.h
============================================================================
$ cvs diff -u -r1.2 -r1.3 llimits.h
--- lua/llimits.h 15 Jul 2007 17:56:10 -0000 1.2
+++ lua/llimits.h 25 Jan 2008 16:54:30 -0000 1.3
@@ -1,5 +1,5 @@
/*
-** $Id: llimits.h,v 1.69 2005/12/27 17:12:00 roberto Exp $
+** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lmathlib.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 lmathlib.c
--- lua/lmathlib.c 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/lmathlib.c 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: lmathlib.c,v 1.67 2005/08/26 17:36:32 roberto Exp $
+** $Id: lmathlib.c,v 1.67.1.1 2007/12/27 13:02:25 roberto Exp $
** Standard mathematical library
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lmem.c
============================================================================
$ cvs diff -u -r1.2 -r1.3 lmem.c
--- lua/lmem.c 15 Jul 2007 17:56:10 -0000 1.2
+++ lua/lmem.c 25 Jan 2008 16:54:30 -0000 1.3
@@ -1,5 +1,5 @@
/*
-** $Id: lmem.c,v 1.70 2005/12/26 13:35:47 roberto Exp $
+** $Id: lmem.c,v 1.70.1.1 2007/12/27 13:02:25 roberto Exp $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lmem.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lmem.h
--- lua/lmem.h 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/lmem.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lmem.h,v 1.31 2005/04/25 19:24:10 roberto Exp $
+** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/loadlib.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 loadlib.c
--- lua/loadlib.c 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/loadlib.c 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: loadlib.c,v 1.54a 2006/07/03 20:16:49 roberto Exp $
+** $Id: loadlib.c,v 1.52.1.2 2007/12/28 14:58:43 roberto Exp $
** Dynamic library loader for Lua
** See Copyright Notice in lua.h
**
@@ .
patch -p0 <<'@@ .'
Index: lua/lobject.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 lobject.c
--- lua/lobject.c 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/lobject.c 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.c,v 2.22 2006/02/10 17:43:52 roberto Exp $
+** $Id: lobject.c,v 2.22.1.1 2007/12/27 13:02:25 roberto Exp $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lobject.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lobject.h
--- lua/lobject.h 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/lobject.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.h,v 2.20 2006/01/18 11:37:34 roberto Exp $
+** $Id: lobject.h,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lopcodes.c
============================================================================
$ cvs diff -u -r1.2 -r1.3 lopcodes.c
--- lua/lopcodes.c 15 Jul 2007 17:56:10 -0000 1.2
+++ lua/lopcodes.c 25 Jan 2008 16:54:30 -0000 1.3
@@ -1,5 +1,5 @@
/*
-** $Id: lopcodes.c,v 1.37 2005/11/08 19:45:36 roberto Exp $
+** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lopcodes.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lopcodes.h
--- lua/lopcodes.h 15 Jul 2007 17:56:10 -0000 1.3
+++ lua/lopcodes.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lopcodes.h,v 1.125 2006/03/14 19:04:44 roberto Exp $
+** $Id: lopcodes.h,v 1.125.1.1 2007/12/27 13:02:25 roberto Exp $
** Opcodes for Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/loslib.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 loslib.c
--- lua/loslib.c 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/loslib.c 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: loslib.c,v 1.20 2006/09/19 13:57:08 roberto Exp $
+** $Id: loslib.c,v 1.19.1.3 2008/01/18 16:38:18 roberto Exp $
** Standard Operating System library
** See Copyright Notice in lua.h
*/
@@ -215,7 +215,6 @@
static int os_exit (lua_State *L) {
exit(luaL_optint(L, 1, EXIT_SUCCESS));
- return 0; /* to avoid warnings */
}
static const luaL_Reg syslib[] = {
@@ .
patch -p0 <<'@@ .'
Index: lua/lparser.c
============================================================================
$ cvs diff -u -r1.5 -r1.6 lparser.c
--- lua/lparser.c 25 Aug 2007 08:15:10 -0000 1.5
+++ lua/lparser.c 25 Jan 2008 16:54:30 -0000 1.6
@@ -1,5 +1,5 @@
/*
-** $Id: lparser.c,v 1.4 2007/07/15 17:56:10 rse Exp $
+** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
@@ -939,7 +939,7 @@
if (nv.v.k == VLOCAL)
check_conflict(ls, lh, &nv.v);
luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls,
- "variable names");
+ "variables in assignment");
assignment(ls, &nv, nvars+1);
}
else { /* assignment -> `=' explist1 */
@@ .
patch -p0 <<'@@ .'
Index: lua/lparser.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lparser.h
--- lua/lparser.h 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/lparser.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lparser.h,v 1.57 2006/03/09 18:14:31 roberto Exp $
+** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lstate.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 lstate.c
--- lua/lstate.c 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/lstate.c 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lstate.c,v 2.36 2006/05/24 14:15:50 roberto Exp $
+** $Id: lstate.c,v 2.36.1.2 2008/01/03 15:20:39 roberto Exp $
** Global State
** See Copyright Notice in lua.h
*/
@@ -93,7 +93,7 @@
resethookcount(L);
L->openupval = NULL;
L->size_ci = 0;
- L->nCcalls = 0;
+ L->nCcalls = L->baseCcalls = 0;
L->status = 0;
L->base_ci = L->ci = NULL;
L->savedpc = NULL;
@@ -205,7 +205,7 @@
do { /* repeat until no more errors */
L->ci = L->base_ci;
L->base = L->top = L->ci->base;
- L->nCcalls = 0;
+ L->nCcalls = L->baseCcalls = 0;
} while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0);
lua_assert(G(L)->tmudata == NULL);
luai_userstateclose(L);
@@ .
patch -p0 <<'@@ .'
Index: lua/lstate.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lstate.h
--- lua/lstate.h 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/lstate.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lstate.h,v 2.24 2006/02/06 18:27:59 roberto Exp $
+** $Id: lstate.h,v 2.24.1.2 2008/01/03 15:20:39 roberto Exp $
** Global State
** See Copyright Notice in lua.h
*/
@@ -112,6 +112,7 @@
int stacksize;
int size_ci; /* size of array `base_ci' */
unsigned short nCcalls; /* number of nested C calls */
+ unsigned short baseCcalls; /* nested C calls when resuming coroutine */
lu_byte hookmask;
lu_byte allowhook;
int basehookcount;
@@ .
patch -p0 <<'@@ .'
Index: lua/lstring.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 lstring.c
--- lua/lstring.c 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/lstring.c 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lstring.c,v 2.8 2005/12/22 16:19:56 roberto Exp $
+** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
** String table (keeps all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lstring.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lstring.h
--- lua/lstring.h 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/lstring.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lstring.h,v 1.43 2005/04/25 19:24:10 roberto Exp $
+** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $
** String table (keep all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lstrlib.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 lstrlib.c
--- lua/lstrlib.c 15 Jul 2007 17:56:11 -0000 1.1
+++ lua/lstrlib.c 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.132a 2006/04/26 20:41:19 roberto Exp $
+** $Id: lstrlib.c,v 1.132.1.3 2007/12/28 15:32:23 roberto Exp $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -629,10 +629,6 @@
lua_gettable(L, 3);
break;
}
- default: {
- luaL_argerror(L, 3, "string/function/table expected");
- return;
- }
}
if (!lua_toboolean(L, -1)) { /* nil or false? */
lua_pop(L, 1);
@@ -648,11 +644,15 @@
size_t srcl;
const char *src = luaL_checklstring(L, 1, &srcl);
const char *p = luaL_checkstring(L, 2);
+ int tr = lua_type(L, 3);
int max_s = luaL_optint(L, 4, srcl+1);
int anchor = (*p == '^') ? (p++, 1) : 0;
int n = 0;
MatchState ms;
luaL_Buffer b;
+ luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING ||
+ tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3,
+ "string/function/table expected");
luaL_buffinit(L, &b);
ms.L = L;
ms.src_init = src;
@@ .
patch -p0 <<'@@ .'
Index: lua/ltable.c
============================================================================
$ cvs diff -u -r1.4 -r1.5 ltable.c
--- lua/ltable.c 25 Aug 2007 08:15:10 -0000 1.4
+++ lua/ltable.c 25 Jan 2008 16:54:30 -0000 1.5
@@ -1,5 +1,5 @@
/*
-** $Id: ltable.c,v 1.3 2007/07/15 17:56:11 rse Exp $
+** $Id: ltable.c,v 2.32.1.2 2007/12/28 15:32:23 roberto Exp $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/ltable.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 ltable.h
--- lua/ltable.h 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/ltable.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: ltable.h,v 2.10 2006/01/10 13:13:06 roberto Exp $
+** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/ltablib.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 ltablib.c
--- lua/ltablib.c 15 Jul 2007 17:56:11 -0000 1.1
+++ lua/ltablib.c 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: ltablib.c,v 1.38 2005/10/23 17:38:15 roberto Exp $
+** $Id: ltablib.c,v 1.38.1.2 2007/12/28 15:32:23 roberto Exp $
** Library for Table Manipulation
** See Copyright Notice in lua.h
*/
@@ -118,7 +118,8 @@
static int tremove (lua_State *L) {
int e = aux_getn(L, 1);
int pos = luaL_optint(L, 2, e);
- if (e == 0) return 0; /* table is `empty' */
+ if (!(1 <= pos && pos <= e)) /* position is outside bounds? */
+ return 0; /* nothing to remove */
luaL_setn(L, 1, e - 1); /* t.n = n-1 */
lua_rawgeti(L, 1, pos); /* result = t[pos] */
for ( ;pos<e; pos++) {
@@ .
patch -p0 <<'@@ .'
Index: lua/ltm.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 ltm.c
--- lua/ltm.c 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/ltm.c 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: ltm.c,v 2.8 2006/01/10 12:50:00 roberto Exp $
+** $Id: ltm.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
** Tag methods
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/ltm.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 ltm.h
--- lua/ltm.h 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/ltm.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: ltm.h,v 2.6 2005/06/06 13:30:25 roberto Exp $
+** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $
** Tag methods
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lua.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 lua.c
--- lua/lua.c 15 Jul 2007 17:56:11 -0000 1.1
+++ lua/lua.c 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: lua.c,v 1.160 2006/06/02 15:34:00 roberto Exp $
+** $Id: lua.c,v 1.160.1.2 2007/12/28 15:32:23 roberto Exp $
** Lua stand-alone interpreter
** See Copyright Notice in lua.h
*/
@@ -74,6 +74,8 @@
static int traceback (lua_State *L) {
+ if (!lua_isstring(L, 1)) /* 'message' not a string? */
+ return 1; /* keep it intact */
lua_getfield(L, LUA_GLOBALSINDEX, "debug");
if (!lua_istable(L, -1)) {
lua_pop(L, 1);
@@ -144,7 +146,7 @@
static int dolibrary (lua_State *L, const char *name) {
lua_getglobal(L, "require");
lua_pushstring(L, name);
- return report(L, lua_pcall(L, 1, 0, 0));
+ return report(L, docall(L, 1, 1));
}
@@ .
patch -p0 <<'@@ .'
Index: lua/lua.h
============================================================================
$ cvs diff -u -r1.1 -r1.2 lua.h
--- lua/lua.h 15 Jul 2007 17:56:11 -0000 1.1
+++ lua/lua.h 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: lua.h,v 1.218a 2006/06/02 15:34:00 roberto Exp $
+** $Id: lua.h,v 1.218.1.4 2008/01/03 15:41:15 roberto Exp $
** Lua - An Extensible Extension Language
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
** See Copyright Notice at the end of this file
@@ -17,9 +17,9 @@
#define LUA_VERSION "Lua 5.1"
-#define LUA_RELEASE "Lua 5.1.2"
+#define LUA_RELEASE "Lua 5.1.3"
#define LUA_VERSION_NUM 501
-#define LUA_COPYRIGHT "Copyright (C) 1994-2007 Lua.org, PUC-Rio"
+#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
@@ -294,6 +294,9 @@
#define lua_Chunkwriter lua_Writer
+/* hack */
+LUA_API void lua_setlevel (lua_State *from, lua_State *to);
+
/*
** {======================================================================
@@ -359,7 +362,7 @@
/******************************************************************************
-* Copyright (C) 1994-2007 Lua.org, PUC-Rio. All rights reserved.
+* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ .
patch -p0 <<'@@ .'
Index: lua/luaconf.h
============================================================================
$ cvs diff -u -r1.1 -r1.2 luaconf.h
--- lua/luaconf.h 15 Jul 2007 17:56:11 -0000 1.1
+++ lua/luaconf.h 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.82a 2006/04/10 18:27:23 roberto Exp $
+** $Id: luaconf.h,v 1.82.1.6 2008/01/18 17:07:48 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -442,7 +442,8 @@
** functions. This limit is arbitrary; its only purpose is to stop C
** functions to consume unlimited stack space.
*/
-#define LUAI_MAXCSTACK 2048
+#define LUAI_MCS_AUX ((int)(INT_MAX / (4*sizeof(LUA_NUMBER))))
+#define LUAI_MAXCSTACK (LUAI_MCS_AUX > SHRT_MAX ? SHRT_MAX : LUAI_MCS_AUX)
@@ -666,7 +667,7 @@
*/
#if defined(LUA_USE_POPEN)
-#define lua_popen(L,c,m) ((void)L, popen(c,m))
+#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m))
#define lua_pclose(L,file) ((void)L, (pclose(file) != -1))
#elif defined(LUA_WIN)
@@ .
patch -p0 <<'@@ .'
Index: lua/lualib.h
============================================================================
$ cvs diff -u -r1.1 -r1.2 lualib.h
--- lua/lualib.h 15 Jul 2007 17:56:11 -0000 1.1
+++ lua/lualib.h 25 Jan 2008 16:54:30 -0000 1.2
@@ -1,5 +1,5 @@
/*
-** $Id: lualib.h,v 1.36 2005/12/27 17:12:00 roberto Exp $
+** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $
** Lua standard libraries
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lundump.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 lundump.c
--- lua/lundump.c 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/lundump.c 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lundump.c,v 1.60 2006/02/16 15:53:49 lhf Exp $
+** $Id: lundump.c,v 2.7.1.2 2008/01/18 16:39:11 roberto Exp $
** load precompiled Lua chunks
** See Copyright Notice in lua.h
*/
@@ -29,6 +29,7 @@
#ifdef LUAC_TRUST_BINARIES
#define IF(c,s)
+#define error(S,s)
#else
#define IF(c,s) if (c) error(S,s)
@@ -47,6 +48,7 @@
static void LoadBlock(LoadState* S, void* b, size_t size)
{
size_t r=luaZ_read(S->Z,b,size);
+ UNUSED(r);
IF (r!=0, "unexpected end");
}
@@ -122,7 +124,7 @@
setsvalue2n(S->L,o,LoadString(S));
break;
default:
- IF (1, "bad constant");
+ error(S,"bad constant");
break;
}
}
@@ .
patch -p0 <<'@@ .'
Index: lua/lundump.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lundump.h
--- lua/lundump.h 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/lundump.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lundump.h,v 1.40 2005/11/11 14:03:13 lhf Exp $
+** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
** load precompiled Lua chunks
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lvm.c
============================================================================
$ cvs diff -u -r1.5 -r1.6 lvm.c
--- lua/lvm.c 25 Aug 2007 08:15:10 -0000 1.5
+++ lua/lvm.c 25 Jan 2008 16:54:30 -0000 1.6
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 1.4 2007/07/15 17:56:11 rse Exp $
+** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lvm.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lvm.h
--- lua/lvm.h 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/lvm.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.h,v 2.5 2005/08/22 18:54:49 roberto Exp $
+** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lzio.c
============================================================================
$ cvs diff -u -r1.2 -r1.3 lzio.c
--- lua/lzio.c 15 Jul 2007 17:56:11 -0000 1.2
+++ lua/lzio.c 25 Jan 2008 16:54:30 -0000 1.3
@@ -1,5 +1,5 @@
/*
-** $Id: lzio.c,v 1.31 2005/06/03 20:15:29 roberto Exp $
+** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
** a generic input stream interface
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: lua/lzio.h
============================================================================
$ cvs diff -u -r1.3 -r1.4 lzio.h
--- lua/lzio.h 15 Jul 2007 17:56:11 -0000 1.3
+++ lua/lzio.h 25 Jan 2008 16:54:30 -0000 1.4
@@ -1,5 +1,5 @@
/*
-** $Id: lzio.h,v 1.21 2005/05/17 19:49:15 roberto Exp $
+** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $
** Buffered streams
** See Copyright Notice in lua.h
*/
@@ .
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.2093 -r1.2094 CHANGES
--- rpm/CHANGES 25 Jan 2008 16:39:25 -0000 1.2093
+++ rpm/CHANGES 25 Jan 2008 16:54:28 -0000 1.2094
@@ -1,4 +1,5 @@
5.0.0 -> 5.1a1:
+ - rse: upgrade from Lua 5.1.2 to Lua 5.1.3 (external and internal)
- jbj: include <pthread.h> everywhere.
- jbj: rpmsq.h doesn't need pthread condvar/mutex any more.
- jbj: QNX does not have insque/remque.
@@ .
patch -p0 <<'@@ .'
Index: rpm/INSTALL
============================================================================
$ cvs diff -u -r2.74 -r2.75 INSTALL
--- rpm/INSTALL 11 Jan 2008 19:06:29 -0000 2.74
+++ rpm/INSTALL 25 Jan 2008 16:54:28 -0000 2.75
@@ -35,7 +35,7 @@
Neon optional 0.26.0 0.27.2 http://www.webdav.org/neon/
Berkeley-DB [1] optional 4.5 4.6.21 http://www.oracle.com/database/berkeley-db.html
SQLite [1] optional 3.3 3.5.4 http://www.sqlite.org/
-Lua [2] optional 5.1 5.1.2 http://www.lua.org/
+Lua [2] optional 5.1 5.1.3 http://www.lua.org/
ZLib [3] optional 1.2 1.2.3 http://www.zlib.net/
Bzip2 optional 1.0 1.0.4 http://www.bzip.org/
LZMA SDK [4] internal 4.27 4.32 http://www.7-zip.org/sdk.html
@@ .
patch -p0 <<'@@ .'
Index: rpm/devtool.conf
============================================================================
$ cvs diff -u -r2.176 -r2.177 devtool.conf
--- rpm/devtool.conf 20 Jan 2008 10:32:35 -0000 2.176
+++ rpm/devtool.conf 25 Jan 2008 16:54:28 -0000 2.177
@@ -221,7 +221,7 @@
v_beecrypt="4.1.2"
v_db="4.6.21"
v_sqlite="3.5.4"
- v_lua="5.1.2"
+ v_lua="5.1.3"
v_file="4.23"
v_popt="1.13"
v_libxml2="2.6.30"
@@ .
patch -p0 <<'@@ .'
Index: xar/Makefile.in
============================================================================
$ cvs diff -u -r1.4 -r1.5 Makefile.in
--- xar/Makefile.in 22 Jan 2008 22:09:35 -0000 1.4
+++ xar/Makefile.in 25 Jan 2008 16:54:34 -0000 1.5
@@ -32,17 +32,19 @@
build_triplet = @build@
host_triplet = @host@
subdir = .
-DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
+DIST_COMMON = $(am__configure_deps) $(srcdir)/../config.guess \
+ $(srcdir)/../config.sub $(srcdir)/../install-sh \
+ $(srcdir)/../ltmain.sh $(srcdir)/../missing \
+ $(srcdir)/../mkinstalldirs $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/configure ChangeLog \
- INSTALL config.guess config.sub depcomp install-sh ltmain.sh \
- missing
+ INSTALL
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
SOURCES =
@@ .
Received on Fri Jan 25 17:54:34 2008