|  |  |  | @ -2,7 +2,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  | # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
 | 
			
		
	
		
			
				
					|  |  |  |  | #
 | 
			
		
	
		
			
				
					|  |  |  |  | # Filename: package/.../lua/lua-5.1.4-upstream-bugfix.patch
 | 
			
		
	
		
			
				
					|  |  |  |  | # Copyright (C) 2010 The OpenSDE Project
 | 
			
		
	
		
			
				
					|  |  |  |  | # Copyright (C) 2011 The OpenSDE Project
 | 
			
		
	
		
			
				
					|  |  |  |  | #
 | 
			
		
	
		
			
				
					|  |  |  |  | # More information can be found in the files COPYING and README.
 | 
			
		
	
		
			
				
					|  |  |  |  | #
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -14,18 +14,25 @@ | 
			
		
	
		
			
				
					|  |  |  |  | # version.
 | 
			
		
	
		
			
				
					|  |  |  |  | # --- SDE-COPYRIGHT-NOTE-END ---
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | diff --git lua-5.1.4/src/lcode.c lua-5.1.4-bugfix/src/lcode.c
 | 
			
		
	
		
			
				
					|  |  |  |  | index cff626b..e9aa88d 100644
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/lcode.c
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/lcode.c
 | 
			
		
	
		
			
				
					|  |  |  |  | # patch-lua-5.1.4-3 created 2011-03-16T19:06:31-0300
 | 
			
		
	
		
			
				
					|  |  |  |  | # apply to a pristine copy of Lua 5.1.4 with:
 | 
			
		
	
		
			
				
					|  |  |  |  | #	wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
 | 
			
		
	
		
			
				
					|  |  |  |  | #	tar zxf lua-5.1.4.tar.gz
 | 
			
		
	
		
			
				
					|  |  |  |  | #	cd lua-5.1.4/src
 | 
			
		
	
		
			
				
					|  |  |  |  | #	wget http://www.lua.org/ftp/patch-lua-5.1.4-3
 | 
			
		
	
		
			
				
					|  |  |  |  | #	patch < patch-lua-5.1.4-3
 | 
			
		
	
		
			
				
					|  |  |  |  | # use curl -O -R if you don't have wget
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/lcode.c	2007/12/28 15:32:23	2.25.1.3
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/lcode.c	2011/01/31 14:53:16	2.25.1.5
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -1,5 +1,5 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  /*
 | 
			
		
	
		
			
				
					|  |  |  |  | -** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
 | 
			
		
	
		
			
				
					|  |  |  |  | +** $Id: lcode.c,v 2.25.1.4 2009/06/15 14:12:25 roberto Exp $
 | 
			
		
	
		
			
				
					|  |  |  |  | +** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $
 | 
			
		
	
		
			
				
					|  |  |  |  |  ** Code generator for Lua
 | 
			
		
	
		
			
				
					|  |  |  |  |  ** See Copyright Notice in lua.h
 | 
			
		
	
		
			
				
					|  |  |  |  |  */
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -544,15 +544,18 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -544,10 +544,6 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |        pc = NO_JUMP;  /* always true; do nothing */
 | 
			
		
	
		
			
				
					|  |  |  |  |        break;
 | 
			
		
	
		
			
				
					|  |  |  |  |      }
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -36,19 +43,7 @@ index cff626b..e9aa88d 100644 | 
			
		
	
		
			
				
					|  |  |  |  |      case VJMP: {
 | 
			
		
	
		
			
				
					|  |  |  |  |        invertjump(fs, e);
 | 
			
		
	
		
			
				
					|  |  |  |  |        pc = e->u.s.info;
 | 
			
		
	
		
			
				
					|  |  |  |  |        break;
 | 
			
		
	
		
			
				
					|  |  |  |  |      }
 | 
			
		
	
		
			
				
					|  |  |  |  | +    case VFALSE: {
 | 
			
		
	
		
			
				
					|  |  |  |  | +      if (!hasjumps(e)) {
 | 
			
		
	
		
			
				
					|  |  |  |  | +        pc = luaK_jump(fs);  /* always jump */
 | 
			
		
	
		
			
				
					|  |  |  |  | +        break;
 | 
			
		
	
		
			
				
					|  |  |  |  | +      }
 | 
			
		
	
		
			
				
					|  |  |  |  | +      /* else go through */
 | 
			
		
	
		
			
				
					|  |  |  |  | +    }
 | 
			
		
	
		
			
				
					|  |  |  |  |      default: {
 | 
			
		
	
		
			
				
					|  |  |  |  |        pc = jumponcond(fs, e, 0);
 | 
			
		
	
		
			
				
					|  |  |  |  |        break;
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -572,14 +575,17 @@ static void luaK_goiffalse (FuncState *fs, expdesc *e) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -572,10 +568,6 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |        pc = NO_JUMP;  /* always false; do nothing */
 | 
			
		
	
		
			
				
					|  |  |  |  |        break;
 | 
			
		
	
		
			
				
					|  |  |  |  |      }
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -59,21 +54,8 @@ index cff626b..e9aa88d 100644 | 
			
		
	
		
			
				
					|  |  |  |  |      case VJMP: {
 | 
			
		
	
		
			
				
					|  |  |  |  |        pc = e->u.s.info;
 | 
			
		
	
		
			
				
					|  |  |  |  |        break;
 | 
			
		
	
		
			
				
					|  |  |  |  |      }
 | 
			
		
	
		
			
				
					|  |  |  |  | +    case VTRUE: {
 | 
			
		
	
		
			
				
					|  |  |  |  | +      if (!hasjumps(e)) {
 | 
			
		
	
		
			
				
					|  |  |  |  | +        pc = luaK_jump(fs);  /* always jump */
 | 
			
		
	
		
			
				
					|  |  |  |  | +        break;
 | 
			
		
	
		
			
				
					|  |  |  |  | +      }
 | 
			
		
	
		
			
				
					|  |  |  |  | +      /* else go through */
 | 
			
		
	
		
			
				
					|  |  |  |  | +    }
 | 
			
		
	
		
			
				
					|  |  |  |  |      default: {
 | 
			
		
	
		
			
				
					|  |  |  |  |        pc = jumponcond(fs, e, 1);
 | 
			
		
	
		
			
				
					|  |  |  |  |        break;
 | 
			
		
	
		
			
				
					|  |  |  |  | diff --git lua-5.1.4/src/ldblib.c lua-5.1.4-bugfix/src/ldblib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | index 67de122..2027eda 100644
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/ldblib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/ldblib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/ldblib.c	2008/01/21 13:11:21	1.104.1.3
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/ldblib.c	2009/08/04 18:50:18	1.104.1.4
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -1,5 +1,5 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  /*
 | 
			
		
	
		
			
				
					|  |  |  |  | -** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -81,7 +63,7 @@ index 67de122..2027eda 100644 | 
			
		
	
		
			
				
					|  |  |  |  |  ** Interface from Lua to its debug API
 | 
			
		
	
		
			
				
					|  |  |  |  |  ** See Copyright Notice in lua.h
 | 
			
		
	
		
			
				
					|  |  |  |  |  */
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -45,6 +45,7 @@ static int db_setmetatable (lua_State *L) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -45,6 +45,7 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  
 | 
			
		
	
		
			
				
					|  |  |  |  |  
 | 
			
		
	
		
			
				
					|  |  |  |  |  static int db_getfenv (lua_State *L) {
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -89,10 +71,8 @@ index 67de122..2027eda 100644 | 
			
		
	
		
			
				
					|  |  |  |  |    lua_getfenv(L, 1);
 | 
			
		
	
		
			
				
					|  |  |  |  |    return 1;
 | 
			
		
	
		
			
				
					|  |  |  |  |  }
 | 
			
		
	
		
			
				
					|  |  |  |  | diff --git lua-5.1.4/src/liolib.c lua-5.1.4-bugfix/src/liolib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | index e79ed1c..649f9a5 100644
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/liolib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/liolib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/liolib.c	2008/01/18 17:47:43	2.73.1.3
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/liolib.c	2010/05/14 15:33:51	2.73.1.4
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -1,5 +1,5 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  /*
 | 
			
		
	
		
			
				
					|  |  |  |  | -** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -100,7 +80,7 @@ index e79ed1c..649f9a5 100644 | 
			
		
	
		
			
				
					|  |  |  |  |  ** Standard I/O (and system) library
 | 
			
		
	
		
			
				
					|  |  |  |  |  ** See Copyright Notice in lua.h
 | 
			
		
	
		
			
				
					|  |  |  |  |  */
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -276,7 +276,10 @@ static int read_number (lua_State *L, FILE *f) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -276,7 +276,10 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |      lua_pushnumber(L, d);
 | 
			
		
	
		
			
				
					|  |  |  |  |      return 1;
 | 
			
		
	
		
			
				
					|  |  |  |  |    }
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -112,10 +92,8 @@ index e79ed1c..649f9a5 100644 | 
			
		
	
		
			
				
					|  |  |  |  |  }
 | 
			
		
	
		
			
				
					|  |  |  |  |  
 | 
			
		
	
		
			
				
					|  |  |  |  |  
 | 
			
		
	
		
			
				
					|  |  |  |  | diff --git lua-5.1.4/src/llex.c lua-5.1.4-bugfix/src/llex.c
 | 
			
		
	
		
			
				
					|  |  |  |  | index 6dc3193..88c6790 100644
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/llex.c
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/llex.c
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/llex.c	2007/12/27 13:02:25	2.20.1.1
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/llex.c	2009/11/23 14:58:22	2.20.1.2
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -1,5 +1,5 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  /*
 | 
			
		
	
		
			
				
					|  |  |  |  | -** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -123,7 +101,7 @@ index 6dc3193..88c6790 100644 | 
			
		
	
		
			
				
					|  |  |  |  |  ** Lexical Analyzer
 | 
			
		
	
		
			
				
					|  |  |  |  |  ** See Copyright Notice in lua.h
 | 
			
		
	
		
			
				
					|  |  |  |  |  */
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -118,8 +118,10 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -118,8 +118,10 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |    lua_State *L = ls->L;
 | 
			
		
	
		
			
				
					|  |  |  |  |    TString *ts = luaS_newlstr(L, str, l);
 | 
			
		
	
		
			
				
					|  |  |  |  |    TValue *o = luaH_setstr(L, ls->fs->h, ts);  /* entry for `str' */
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -135,10 +113,8 @@ index 6dc3193..88c6790 100644 | 
			
		
	
		
			
				
					|  |  |  |  |    return ts;
 | 
			
		
	
		
			
				
					|  |  |  |  |  }
 | 
			
		
	
		
			
				
					|  |  |  |  |  
 | 
			
		
	
		
			
				
					|  |  |  |  | diff --git lua-5.1.4/src/loadlib.c lua-5.1.4-bugfix/src/loadlib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | index 0d401eb..6158c53 100644
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/loadlib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/loadlib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/loadlib.c	2008/08/06 13:29:28	1.52.1.3
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/loadlib.c	2009/09/09 13:17:16	1.52.1.4
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -1,5 +1,5 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  /*
 | 
			
		
	
		
			
				
					|  |  |  |  | -** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -146,7 +122,7 @@ index 0d401eb..6158c53 100644 | 
			
		
	
		
			
				
					|  |  |  |  |  ** Dynamic library loader for Lua
 | 
			
		
	
		
			
				
					|  |  |  |  |  ** See Copyright Notice in lua.h
 | 
			
		
	
		
			
				
					|  |  |  |  |  **
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -639,7 +639,7 @@ LUALIB_API int luaopen_package (lua_State *L) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -639,7 +639,7 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |    lua_pushvalue(L, -1);
 | 
			
		
	
		
			
				
					|  |  |  |  |    lua_replace(L, LUA_ENVIRONINDEX);
 | 
			
		
	
		
			
				
					|  |  |  |  |    /* create `loaders' table */
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -155,10 +131,8 @@ index 0d401eb..6158c53 100644 | 
			
		
	
		
			
				
					|  |  |  |  |    /* fill it with pre-defined loaders */
 | 
			
		
	
		
			
				
					|  |  |  |  |    for (i=0; loaders[i] != NULL; i++) {
 | 
			
		
	
		
			
				
					|  |  |  |  |      lua_pushcfunction(L, loaders[i]);
 | 
			
		
	
		
			
				
					|  |  |  |  | diff --git lua-5.1.4/src/lstrlib.c lua-5.1.4-bugfix/src/lstrlib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | index 1b4763d..7a03489 100644
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/lstrlib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/lstrlib.c
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/lstrlib.c	2008/07/11 17:27:21	1.132.1.4
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/lstrlib.c	2010/05/14 15:34:19	1.132.1.5
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -1,5 +1,5 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  /*
 | 
			
		
	
		
			
				
					|  |  |  |  | -** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -166,7 +140,7 @@ index 1b4763d..7a03489 100644 | 
			
		
	
		
			
				
					|  |  |  |  |  ** Standard library for string operations and pattern-matching
 | 
			
		
	
		
			
				
					|  |  |  |  |  ** See Copyright Notice in lua.h
 | 
			
		
	
		
			
				
					|  |  |  |  |  */
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -754,6 +754,7 @@ static void addintlen (char *form) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -754,6 +754,7 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  
 | 
			
		
	
		
			
				
					|  |  |  |  |  
 | 
			
		
	
		
			
				
					|  |  |  |  |  static int str_format (lua_State *L) {
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -174,7 +148,7 @@ index 1b4763d..7a03489 100644 | 
			
		
	
		
			
				
					|  |  |  |  |    int arg = 1;
 | 
			
		
	
		
			
				
					|  |  |  |  |    size_t sfl;
 | 
			
		
	
		
			
				
					|  |  |  |  |    const char *strfrmt = luaL_checklstring(L, arg, &sfl);
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -768,7 +769,8 @@ static int str_format (lua_State *L) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -768,7 +769,8 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |      else { /* format item */
 | 
			
		
	
		
			
				
					|  |  |  |  |        char form[MAX_FORMAT];  /* to store the format (`%...') */
 | 
			
		
	
		
			
				
					|  |  |  |  |        char buff[MAX_ITEM];  /* to store the formatted item */
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -184,10 +158,8 @@ index 1b4763d..7a03489 100644 | 
			
		
	
		
			
				
					|  |  |  |  |        strfrmt = scanformat(L, strfrmt, form);
 | 
			
		
	
		
			
				
					|  |  |  |  |        switch (*strfrmt++) {
 | 
			
		
	
		
			
				
					|  |  |  |  |          case 'c': {
 | 
			
		
	
		
			
				
					|  |  |  |  | diff --git lua-5.1.4/src/lvm.c lua-5.1.4-bugfix/src/lvm.c
 | 
			
		
	
		
			
				
					|  |  |  |  | index ee3256a..8aeafda 100644
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/lvm.c
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/lvm.c
 | 
			
		
	
		
			
				
					|  |  |  |  | --- lua-5.1.4/src/lvm.c	2007/12/28 15:32:23	2.63.1.3
 | 
			
		
	
		
			
				
					|  |  |  |  | +++ lua-5.1.4-bugfix/src/lvm.c	2009/07/01 21:10:33	2.63.1.4
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -1,5 +1,5 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  /*
 | 
			
		
	
		
			
				
					|  |  |  |  | -** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -195,7 +167,7 @@ index ee3256a..8aeafda 100644 | 
			
		
	
		
			
				
					|  |  |  |  |  ** Lua virtual machine
 | 
			
		
	
		
			
				
					|  |  |  |  |  ** See Copyright Notice in lua.h
 | 
			
		
	
		
			
				
					|  |  |  |  |  */
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -133,6 +133,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -133,6 +133,7 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |  
 | 
			
		
	
		
			
				
					|  |  |  |  |  void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
 | 
			
		
	
		
			
				
					|  |  |  |  |    int loop;
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -203,7 +175,7 @@ index ee3256a..8aeafda 100644 | 
			
		
	
		
			
				
					|  |  |  |  |    for (loop = 0; loop < MAXTAGLOOP; loop++) {
 | 
			
		
	
		
			
				
					|  |  |  |  |      const TValue *tm;
 | 
			
		
	
		
			
				
					|  |  |  |  |      if (ttistable(t)) {  /* `t' is a table? */
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -152,7 +153,9 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
 | 
			
		
	
		
			
				
					|  |  |  |  | @@ -152,7 +153,9 @@
 | 
			
		
	
		
			
				
					|  |  |  |  |        callTM(L, tm, t, key, val);
 | 
			
		
	
		
			
				
					|  |  |  |  |        return;
 | 
			
		
	
		
			
				
					|  |  |  |  |      }
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |