From 98487dbc5b2650a1f17bd9454e4d0a6b966c033d Mon Sep 17 00:00:00 2001 From: dartraiden Date: Tue, 10 Jul 2018 17:32:21 +0300 Subject: liblua: update to Lua 5.3.5 --- libs/liblua/docs/lua.css | 33 +++++++-------- libs/liblua/docs/readme.html | 6 +-- libs/liblua/include/lua.hpp | 6 +-- libs/liblua/src/lapi.c | 7 ++-- libs/liblua/src/lapi.h | 2 +- libs/liblua/src/lauxlib.c | 2 +- libs/liblua/src/lauxlib.h | 2 +- libs/liblua/src/lbaselib.c | 2 +- libs/liblua/src/lbitlib.c | 2 +- libs/liblua/src/lcode.c | 2 +- libs/liblua/src/lcode.h | 2 +- libs/liblua/src/lcorolib.c | 2 +- libs/liblua/src/lctype.c | 2 +- libs/liblua/src/lctype.h | 2 +- libs/liblua/src/ldblib.c | 2 +- libs/liblua/src/ldebug.c | 3 +- libs/liblua/src/ldebug.h | 2 +- libs/liblua/src/ldo.c | 2 +- libs/liblua/src/ldo.h | 2 +- libs/liblua/src/ldump.c | 2 +- libs/liblua/src/lfunc.c | 2 +- libs/liblua/src/lfunc.h | 2 +- libs/liblua/src/lgc.c | 5 ++- libs/liblua/src/lgc.h | 2 +- libs/liblua/src/linit.c | 2 +- libs/liblua/src/liolib.c | 13 ++++-- libs/liblua/src/llex.c | 2 +- libs/liblua/src/llex.h | 2 +- libs/liblua/src/llimits.h | 2 +- libs/liblua/src/lmathlib.c | 2 +- libs/liblua/src/lmem.c | 2 +- libs/liblua/src/lmem.h | 2 +- libs/liblua/src/loadlib.c | 97 +++++++++++++++++++++++++++++++++++++++++--- libs/liblua/src/lobject.c | 5 ++- libs/liblua/src/lobject.h | 2 +- libs/liblua/src/lopcodes.c | 2 +- libs/liblua/src/lopcodes.h | 2 +- libs/liblua/src/loslib.c | 8 ++-- libs/liblua/src/lparser.c | 4 +- libs/liblua/src/lparser.h | 2 +- libs/liblua/src/lprefix.h | 2 +- libs/liblua/src/lstate.c | 5 +-- libs/liblua/src/lstate.h | 20 ++++++++- libs/liblua/src/lstring.c | 2 +- libs/liblua/src/lstring.h | 2 +- libs/liblua/src/lstrlib.c | 8 ++-- libs/liblua/src/ltable.c | 35 ++++++++++++---- libs/liblua/src/ltable.h | 4 +- libs/liblua/src/ltablib.c | 2 +- libs/liblua/src/ltm.c | 2 +- libs/liblua/src/ltm.h | 2 +- libs/liblua/src/lua.h | 8 ++-- libs/liblua/src/luaconf.h | 9 +++- libs/liblua/src/lualib.h | 5 ++- libs/liblua/src/lundump.c | 2 +- libs/liblua/src/lundump.h | 2 +- libs/liblua/src/lutf8lib.c | 4 +- libs/liblua/src/lvm.c | 2 +- libs/liblua/src/lvm.h | 2 +- libs/liblua/src/lzio.c | 2 +- libs/liblua/src/lzio.h | 2 +- 61 files changed, 253 insertions(+), 114 deletions(-) (limited to 'libs/liblua') diff --git a/libs/liblua/docs/lua.css b/libs/liblua/docs/lua.css index 5bedf7eb89..cbd0799d15 100644 --- a/libs/liblua/docs/lua.css +++ b/libs/liblua/docs/lua.css @@ -10,7 +10,7 @@ body { line-height: 1.25 ; margin: 16px auto ; padding: 32px ; - border: solid #a0a0a0 1px ; + border: solid #ccc 1px ; border-radius: 20px ; max-width: 70em ; width: 90% ; @@ -111,36 +111,29 @@ pre.session { border-radius: 8px ; } -td.gutter { - width: 4% ; -} - -table.columns { +table { border: none ; border-spacing: 0 ; border-collapse: collapse ; } -table.columns td { - vertical-align: top ; +td { padding: 0 ; - padding-bottom: 1em ; - text-align: justify ; - line-height: 1.25 ; + margin: 0 ; } -p.logos a:link:hover, p.logos a:visited:hover { - background-color: inherit ; +td.gutter { + width: 4% ; } -table.book { - border: none ; - border-spacing: 0 ; - border-collapse: collapse ; +table.columns td { + vertical-align: top ; + padding-bottom: 1em ; + text-align: justify ; + line-height: 1.25 ; } table.book td { - padding: 0 ; vertical-align: top ; } @@ -159,6 +152,10 @@ table.book span { margin-top: 0.25em ; } +p.logos a:link:hover, p.logos a:visited:hover { + background-color: inherit ; +} + img { background-color: white ; } diff --git a/libs/liblua/docs/readme.html b/libs/liblua/docs/readme.html index 96a9386e2a..b118f7b02d 100644 --- a/libs/liblua/docs/readme.html +++ b/libs/liblua/docs/readme.html @@ -107,7 +107,7 @@ Here are the details.
  1. Open a terminal window and move to -the top-level directory, which is named lua-5.3.x. +the top-level directory, which is named lua-5.3.5. The Makefile there controls both the build process and the installation process.

  2. @@ -355,10 +355,10 @@ THE SOFTWARE. diff --git a/libs/liblua/include/lua.hpp b/libs/liblua/include/lua.hpp index 4030829227..ec417f5946 100644 --- a/libs/liblua/include/lua.hpp +++ b/libs/liblua/include/lua.hpp @@ -3,7 +3,7 @@ // <> not supplied automatically because Lua also compiles as C++ extern "C" { -#include "../src/lua.h" -#include "../src/lualib.h" -#include "../src/lauxlib.h" +#include "lua.h" +#include "lualib.h" +#include "lauxlib.h" } diff --git a/libs/liblua/src/lapi.c b/libs/liblua/src/lapi.c index 1c4d07ddaf..02b7fab7ea 100644 --- a/libs/liblua/src/lapi.c +++ b/libs/liblua/src/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.258 2016/01/05 16:07:21 roberto Exp roberto $ +** $Id: lapi.c,v 2.259.1.2 2017/12/06 18:35:12 roberto Exp $ ** Lua API ** See Copyright Notice in lua.h */ @@ -533,6 +533,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { lua_lock(L); if (n == 0) { setfvalue(L->top, fn); + api_incr_top(L); } else { CClosure *cl; @@ -546,9 +547,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { /* does not need barrier because closure is white */ } setclCvalue(L, L->top, cl); + api_incr_top(L); + luaC_checkGC(L); } - api_incr_top(L); - luaC_checkGC(L); lua_unlock(L); } diff --git a/libs/liblua/src/lapi.h b/libs/liblua/src/lapi.h index b39898ebd5..8e16ad53d9 100644 --- a/libs/liblua/src/lapi.h +++ b/libs/liblua/src/lapi.h @@ -1,5 +1,5 @@ /* -** $Id: lapi.h,v 2.8 2014/07/15 21:26:50 roberto Exp roberto $ +** $Id: lapi.h,v 2.9.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions from Lua API ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lauxlib.c b/libs/liblua/src/lauxlib.c index 7b14ca4d2b..8bdada50a7 100644 --- a/libs/liblua/src/lauxlib.c +++ b/libs/liblua/src/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.288 2016/12/04 20:17:24 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.289.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lauxlib.h b/libs/liblua/src/lauxlib.h index 1d65c975ad..9857d3a835 100644 --- a/libs/liblua/src/lauxlib.h +++ b/libs/liblua/src/lauxlib.h @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.130 2016/12/04 20:17:24 roberto Exp roberto $ +** $Id: lauxlib.h,v 1.131.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lbaselib.c b/libs/liblua/src/lbaselib.c index 98602952c4..6460e4f8d4 100644 --- a/libs/liblua/src/lbaselib.c +++ b/libs/liblua/src/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.313 2016/04/11 19:18:40 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.314.1.1 2017/04/19 17:39:34 roberto Exp $ ** Basic library ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lbitlib.c b/libs/liblua/src/lbitlib.c index 02483d695b..4786c0d483 100644 --- a/libs/liblua/src/lbitlib.c +++ b/libs/liblua/src/lbitlib.c @@ -1,5 +1,5 @@ /* -** $Id: lbitlib.c,v 1.29 2015/10/08 15:55:35 roberto Exp roberto $ +** $Id: lbitlib.c,v 1.30.1.1 2017/04/19 17:20:42 roberto Exp $ ** Standard library for bitwise operations ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lcode.c b/libs/liblua/src/lcode.c index aca0256d44..12619f54a0 100644 --- a/libs/liblua/src/lcode.c +++ b/libs/liblua/src/lcode.c @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.111 2016/07/19 17:12:07 roberto Exp roberto $ +** $Id: lcode.c,v 2.112.1.1 2017/04/19 17:20:42 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lcode.h b/libs/liblua/src/lcode.h index d2b5100e18..882dc9c156 100644 --- a/libs/liblua/src/lcode.h +++ b/libs/liblua/src/lcode.h @@ -1,5 +1,5 @@ /* -** $Id: lcode.h,v 1.63 2013/12/30 20:47:58 roberto Exp roberto $ +** $Id: lcode.h,v 1.64.1.1 2017/04/19 17:20:42 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lcorolib.c b/libs/liblua/src/lcorolib.c index 95467264cd..0b17af9e34 100644 --- a/libs/liblua/src/lcorolib.c +++ b/libs/liblua/src/lcorolib.c @@ -1,5 +1,5 @@ /* -** $Id: lcorolib.c,v 1.9 2014/11/02 19:19:04 roberto Exp roberto $ +** $Id: lcorolib.c,v 1.10.1.1 2017/04/19 17:20:42 roberto Exp $ ** Coroutine Library ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lctype.c b/libs/liblua/src/lctype.c index 367640c662..f8ad7a2edf 100644 --- a/libs/liblua/src/lctype.c +++ b/libs/liblua/src/lctype.c @@ -1,5 +1,5 @@ /* -** $Id: lctype.c,v 1.11 2011/10/03 16:19:23 roberto Exp roberto $ +** $Id: lctype.c,v 1.12.1.1 2017/04/19 17:20:42 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lctype.h b/libs/liblua/src/lctype.h index 5dc17013c2..b09b21a337 100644 --- a/libs/liblua/src/lctype.h +++ b/libs/liblua/src/lctype.h @@ -1,5 +1,5 @@ /* -** $Id: lctype.h,v 1.11 2011/06/27 18:22:46 roberto Exp roberto $ +** $Id: lctype.h,v 1.12.1.1 2013/04/12 18:48:47 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/ldblib.c b/libs/liblua/src/ldblib.c index 0bcd2e9e93..9d29afb0a8 100644 --- a/libs/liblua/src/ldblib.c +++ b/libs/liblua/src/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.150 2015/11/19 19:16:22 roberto Exp roberto $ +** $Id: ldblib.c,v 1.151.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/ldebug.c b/libs/liblua/src/ldebug.c index f1835890a5..e1389296e9 100644 --- a/libs/liblua/src/ldebug.c +++ b/libs/liblua/src/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.120 2016/03/31 19:01:21 roberto Exp roberto $ +** $Id: ldebug.c,v 2.121.1.2 2017/07/10 17:21:50 roberto Exp $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -653,6 +653,7 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { CallInfo *ci = L->ci; const char *msg; va_list argp; + luaC_checkGC(L); /* error message uses memory */ va_start(argp, fmt); msg = luaO_pushvfstring(L, fmt, argp); /* format message */ va_end(argp); diff --git a/libs/liblua/src/ldebug.h b/libs/liblua/src/ldebug.h index 9c0a03a6fe..8cea0ee0a7 100644 --- a/libs/liblua/src/ldebug.h +++ b/libs/liblua/src/ldebug.h @@ -1,5 +1,5 @@ /* -** $Id: ldebug.h,v 2.13 2015/03/11 16:10:41 roberto Exp roberto $ +** $Id: ldebug.h,v 2.14.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions from Debug Interface module ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/ldo.c b/libs/liblua/src/ldo.c index 1338751602..316e45c8fe 100644 --- a/libs/liblua/src/ldo.c +++ b/libs/liblua/src/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 2.156 2016/09/20 16:37:45 roberto Exp roberto $ +** $Id: ldo.c,v 2.157.1.1 2017/04/19 17:20:42 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/ldo.h b/libs/liblua/src/ldo.h index b2065cfa68..3b2983a386 100644 --- a/libs/liblua/src/ldo.h +++ b/libs/liblua/src/ldo.h @@ -1,5 +1,5 @@ /* -** $Id: ldo.h,v 2.28 2015/11/23 11:29:43 roberto Exp roberto $ +** $Id: ldo.h,v 2.29.1.1 2017/04/19 17:20:42 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/ldump.c b/libs/liblua/src/ldump.c index 19030edc87..f025acac3c 100644 --- a/libs/liblua/src/ldump.c +++ b/libs/liblua/src/ldump.c @@ -1,5 +1,5 @@ /* -** $Id: ldump.c,v 2.36 2015/03/30 15:43:51 roberto Exp roberto $ +** $Id: ldump.c,v 2.37.1.1 2017/04/19 17:20:42 roberto Exp $ ** save precompiled Lua chunks ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lfunc.c b/libs/liblua/src/lfunc.c index 4c10230e3f..ccafbb8ab3 100644 --- a/libs/liblua/src/lfunc.c +++ b/libs/liblua/src/lfunc.c @@ -1,5 +1,5 @@ /* -** $Id: lfunc.c,v 2.44 2014/10/25 11:50:46 roberto Exp roberto $ +** $Id: lfunc.c,v 2.45.1.1 2017/04/19 17:39:34 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lfunc.h b/libs/liblua/src/lfunc.h index 6fd3fbac03..c916e9878a 100644 --- a/libs/liblua/src/lfunc.h +++ b/libs/liblua/src/lfunc.h @@ -1,5 +1,5 @@ /* -** $Id: lfunc.h,v 2.14 2014/06/19 18:27:20 roberto Exp roberto $ +** $Id: lfunc.h,v 2.15.1.1 2017/04/19 17:39:34 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lgc.c b/libs/liblua/src/lgc.c index de3f2a2155..db4df82922 100644 --- a/libs/liblua/src/lgc.c +++ b/libs/liblua/src/lgc.c @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 2.214 2016/11/07 12:38:35 roberto Exp roberto $ +** $Id: lgc.c,v 2.215.1.2 2017/08/31 16:15:27 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -643,8 +643,9 @@ static void clearkeys (global_State *g, GCObject *l, GCObject *f) { for (n = gnode(h, 0); n < limit; n++) { if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) { setnilvalue(gval(n)); /* remove value ... */ - removeentry(n); /* and remove entry from table */ } + if (ttisnil(gval(n))) /* is entry empty? */ + removeentry(n); /* remove entry from table */ } } } diff --git a/libs/liblua/src/lgc.h b/libs/liblua/src/lgc.h index 75f24bc03d..425cd7cef3 100644 --- a/libs/liblua/src/lgc.h +++ b/libs/liblua/src/lgc.h @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.90 2015/10/21 18:15:15 roberto Exp roberto $ +** $Id: lgc.h,v 2.91.1.1 2017/04/19 17:39:34 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/linit.c b/libs/liblua/src/linit.c index 897ae3523b..480da52c7e 100644 --- a/libs/liblua/src/linit.c +++ b/libs/liblua/src/linit.c @@ -1,5 +1,5 @@ /* -** $Id: linit.c,v 1.38 2015/01/05 13:48:33 roberto Exp roberto $ +** $Id: linit.c,v 1.39.1.1 2017/04/19 17:20:42 roberto Exp $ ** Initialization of libraries for lua.c and other clients ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/liolib.c b/libs/liblua/src/liolib.c index 8491edca39..8a9e75cd08 100644 --- a/libs/liblua/src/liolib.c +++ b/libs/liblua/src/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.150 2016/09/01 16:14:56 roberto Exp roberto $ +** $Id: liolib.c,v 2.151.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -206,11 +206,16 @@ static int aux_close (lua_State *L) { } +static int f_close (lua_State *L) { + tofile(L); /* make sure argument is an open stream */ + return aux_close(L); +} + + static int io_close (lua_State *L) { if (lua_isnone(L, 1)) /* no argument? */ lua_getfield(L, LUA_REGISTRYINDEX, IO_OUTPUT); /* use standard output */ - tofile(L); /* make sure argument is an open stream */ - return aux_close(L); + return f_close(L); } @@ -712,7 +717,7 @@ static const luaL_Reg iolib[] = { ** methods for file handles */ static const luaL_Reg flib[] = { - {"close", io_close}, + {"close", f_close}, {"flush", f_flush}, {"lines", f_lines}, {"read", f_read}, diff --git a/libs/liblua/src/llex.c b/libs/liblua/src/llex.c index 8f44cbef2e..66fd411ba9 100644 --- a/libs/liblua/src/llex.c +++ b/libs/liblua/src/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 2.95 2015/11/19 19:16:22 roberto Exp roberto $ +** $Id: llex.c,v 2.96.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/llex.h b/libs/liblua/src/llex.h index a50b687351..2ed0af66a4 100644 --- a/libs/liblua/src/llex.h +++ b/libs/liblua/src/llex.h @@ -1,5 +1,5 @@ /* -** $Id: llex.h,v 1.78 2014/10/29 15:38:24 roberto Exp roberto $ +** $Id: llex.h,v 1.79.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/llimits.h b/libs/liblua/src/llimits.h index fa14dfc739..d1036f6bc8 100644 --- a/libs/liblua/src/llimits.h +++ b/libs/liblua/src/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.140 2015/10/21 18:40:47 roberto Exp roberto $ +** $Id: llimits.h,v 1.141.1.1 2017/04/19 17:20:42 roberto Exp $ ** Limits, basic types, and some other 'installation-dependent' definitions ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lmathlib.c b/libs/liblua/src/lmathlib.c index e0240c9b54..7ef7e593fd 100644 --- a/libs/liblua/src/lmathlib.c +++ b/libs/liblua/src/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.118 2016/12/20 18:37:00 roberto Exp roberto $ +** $Id: lmathlib.c,v 1.119.1.1 2017/04/19 17:20:42 roberto Exp $ ** Standard mathematical library ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lmem.c b/libs/liblua/src/lmem.c index 83a9082c5f..0241cc3bac 100644 --- a/libs/liblua/src/lmem.c +++ b/libs/liblua/src/lmem.c @@ -1,5 +1,5 @@ /* -** $Id: lmem.c,v 1.90 2015/03/03 18:18:29 roberto Exp roberto $ +** $Id: lmem.c,v 1.91.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lmem.h b/libs/liblua/src/lmem.h index 7af316f020..357b1e43e7 100644 --- a/libs/liblua/src/lmem.h +++ b/libs/liblua/src/lmem.h @@ -1,5 +1,5 @@ /* -** $Id: lmem.h,v 1.42 2014/12/19 13:45:40 roberto Exp roberto $ +** $Id: lmem.h,v 1.43.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/loadlib.c b/libs/liblua/src/loadlib.c index 16526603e6..45f44d3225 100644 --- a/libs/liblua/src/loadlib.c +++ b/libs/liblua/src/loadlib.c @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.128 2016/07/18 17:55:59 roberto Exp roberto $ +** $Id: loadlib.c,v 1.130.1.1 2017/04/19 17:20:42 roberto Exp $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** @@ -64,6 +64,9 @@ static const int CLIBS = 0; #define LIB_FAIL "open" +#define setprogdir(L) ((void)0) + + /* ** system-dependent functions */ @@ -155,6 +158,30 @@ static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) { #endif +#undef setprogdir + + +/* +** Replace in the path (on the top of the stack) any occurrence +** of LUA_EXEC_DIR with the executable's path. +*/ +static void setprogdir (lua_State *L) { + char buff[MAX_PATH + 1]; + char *lb; + DWORD nsize = sizeof(buff)/sizeof(char); + DWORD n = GetModuleFileNameA(NULL, buff, nsize); /* get exec. name */ + if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL) + luaL_error(L, "unable to get ModuleFileName"); + else { + *lb = '\0'; /* cut name on the last '\\' to get the path */ + luaL_gsub(L, lua_tostring(L, -1), LUA_EXEC_DIR, buff); + lua_remove(L, -2); /* remove original string */ + } +} + + + + static void pusherror (lua_State *L) { int error = GetLastError(); char buffer[128]; @@ -223,6 +250,67 @@ static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) { #endif /* } */ +/* +** {================================================================== +** Set Paths +** =================================================================== +*/ + +/* +** LUA_PATH_VAR and LUA_CPATH_VAR are the names of the environment +** variables that Lua check to set its paths. +*/ +#if !defined(LUA_PATH_VAR) +#define LUA_PATH_VAR "LUA_PATH" +#endif + +#if !defined(LUA_CPATH_VAR) +#define LUA_CPATH_VAR "LUA_CPATH" +#endif + + +#define AUXMARK "\1" /* auxiliary mark */ + + +/* +** return registry.LUA_NOENV as a boolean +*/ +static int noenv (lua_State *L) { + int b; + lua_getfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); + b = lua_toboolean(L, -1); + lua_pop(L, 1); /* remove value */ + return b; +} + + +/* +** Set a path +*/ +static void setpath (lua_State *L, const char *fieldname, + const char *envname, + const char *dft) { + const char *nver = lua_pushfstring(L, "%s%s", envname, LUA_VERSUFFIX); + const char *path = getenv(nver); /* use versioned name */ + if (path == NULL) /* no environment variable? */ + path = getenv(envname); /* try unversioned name */ + if (path == NULL || noenv(L)) /* no environment variable? */ + lua_pushstring(L, dft); /* use default */ + else { + /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */ + path = luaL_gsub(L, path, LUA_PATH_SEP LUA_PATH_SEP, + LUA_PATH_SEP AUXMARK LUA_PATH_SEP); + luaL_gsub(L, path, AUXMARK, dft); + lua_remove(L, -2); /* remove result from 1st 'gsub' */ + } + setprogdir(L); + lua_setfield(L, -3, fieldname); /* package[fieldname] = path value */ + lua_pop(L, 1); /* pop versioned variable name */ +} + +/* }================================================================== */ + + /* ** return registry.CLIBS[path] */ @@ -680,10 +768,9 @@ LUAMOD_API int luaopen_package (lua_State *L) { createclibstable(L); luaL_newlib(L, pk_funcs); /* create 'package' table */ createsearcherstable(L); - lua_pushstring(L, LUA_PATH_DEFAULT); - lua_setfield(L, -2, "path"); /* package.path = default path */ - lua_pushstring(L, LUA_CPATH_DEFAULT); - lua_setfield(L, -2, "cpath"); /* package.cpath = default cpath */ + /* set paths */ + setpath(L, "path", LUA_PATH_VAR, LUA_PATH_DEFAULT); + setpath(L, "cpath", LUA_CPATH_VAR, LUA_CPATH_DEFAULT); /* store config information */ lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATH_SEP "\n" LUA_PATH_MARK "\n" LUA_EXEC_DIR "\n" LUA_IGMARK "\n"); diff --git a/libs/liblua/src/lobject.c b/libs/liblua/src/lobject.c index e234df3d61..2218c8cdd7 100644 --- a/libs/liblua/src/lobject.c +++ b/libs/liblua/src/lobject.c @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 2.112 2016/06/27 13:15:08 roberto Exp roberto $ +** $Id: lobject.c,v 2.113.1.1 2017/04/19 17:29:57 roberto Exp $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -435,7 +435,8 @@ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { } case 'p': { /* a pointer */ char buff[4*sizeof(void *) + 8]; /* should be enough space for a '%p' */ - int l = l_sprintf(buff, sizeof(buff), "%p", va_arg(argp, void *)); + void *p = va_arg(argp, void *); + int l = lua_pointer2str(buff, sizeof(buff), p); pushstr(L, buff, l); break; } diff --git a/libs/liblua/src/lobject.h b/libs/liblua/src/lobject.h index eeddfdef50..2408861402 100644 --- a/libs/liblua/src/lobject.h +++ b/libs/liblua/src/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.116 2015/11/03 18:33:10 roberto Exp roberto $ +** $Id: lobject.h,v 2.117.1.1 2017/04/19 17:39:34 roberto Exp $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lopcodes.c b/libs/liblua/src/lopcodes.c index 10d4bbce17..5ca3eb261a 100644 --- a/libs/liblua/src/lopcodes.c +++ b/libs/liblua/src/lopcodes.c @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.c,v 1.54 2014/11/02 19:19:04 roberto Exp roberto $ +** $Id: lopcodes.c,v 1.55.1.1 2017/04/19 17:20:42 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lopcodes.h b/libs/liblua/src/lopcodes.h index dd2a7571d9..6feaa1cd07 100644 --- a/libs/liblua/src/lopcodes.h +++ b/libs/liblua/src/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.148 2014/10/25 11:50:46 roberto Exp roberto $ +** $Id: lopcodes.h,v 1.149.1.1 2017/04/19 17:20:42 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/loslib.c b/libs/liblua/src/loslib.c index dd2bb378d1..de590c6b71 100644 --- a/libs/liblua/src/loslib.c +++ b/libs/liblua/src/loslib.c @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.64 2016/04/18 13:06:55 roberto Exp $ +** $Id: loslib.c,v 1.65.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -293,7 +293,8 @@ static int os_date (lua_State *L) { else stm = l_localtime(&t, &tmr); if (stm == NULL) /* invalid date? */ - luaL_error(L, "time result cannot be represented in this installation"); + return luaL_error(L, + "time result cannot be represented in this installation"); if (strcmp(s, "*t") == 0) { lua_createtable(L, 0, 9); /* 9 = number of fields */ setallfields(L, stm); @@ -340,7 +341,8 @@ static int os_time (lua_State *L) { setallfields(L, &ts); /* update fields with normalized values */ } if (t != (time_t)(l_timet)t || t == (time_t)(-1)) - luaL_error(L, "time result cannot be represented in this installation"); + return luaL_error(L, + "time result cannot be represented in this installation"); l_pushtime(L, t); return 1; } diff --git a/libs/liblua/src/lparser.c b/libs/liblua/src/lparser.c index 5894d8ffc7..cc54de43c6 100644 --- a/libs/liblua/src/lparser.c +++ b/libs/liblua/src/lparser.c @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 2.154 2016/06/22 15:48:25 roberto Exp roberto $ +** $Id: lparser.c,v 2.155.1.2 2017/04/29 18:11:40 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -1392,7 +1392,7 @@ static void test_then_block (LexState *ls, int *escapelist) { luaK_goiffalse(ls->fs, &v); /* will jump to label if condition is true */ enterblock(fs, &bl, 0); /* must enter block before 'goto' */ gotostat(ls, v.t); /* handle goto/break */ - skipnoopstat(ls); /* skip other no-op statements */ + while (testnext(ls, ';')) {} /* skip colons */ if (block_follow(ls, 0)) { /* 'goto' is the entire block? */ leaveblock(fs); return; /* and that is it */ diff --git a/libs/liblua/src/lparser.h b/libs/liblua/src/lparser.h index 13e613accc..f45b23cba5 100644 --- a/libs/liblua/src/lparser.h +++ b/libs/liblua/src/lparser.h @@ -1,5 +1,5 @@ /* -** $Id: lparser.h,v 1.75 2015/12/17 15:44:50 roberto Exp roberto $ +** $Id: lparser.h,v 1.76.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lprefix.h b/libs/liblua/src/lprefix.h index 6b72f0eba7..9a749a3f30 100644 --- a/libs/liblua/src/lprefix.h +++ b/libs/liblua/src/lprefix.h @@ -1,5 +1,5 @@ /* -** $Id: lprefix.h,v 1.1 2014/11/03 15:12:44 roberto Exp roberto $ +** $Id: lprefix.h,v 1.2.1.1 2017/04/19 17:20:42 roberto Exp $ ** Definitions for Lua code that must come before any other header file ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lstate.c b/libs/liblua/src/lstate.c index 0c056f9041..c1a76643c3 100644 --- a/libs/liblua/src/lstate.c +++ b/libs/liblua/src/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.132 2015/11/02 16:01:41 roberto Exp roberto $ +** $Id: lstate.c,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ @@ -339,9 +339,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { LUA_API void lua_close (lua_State *L) { - if (!L) - return; - L = G(L)->mainthread; /* only the main thread can be closed */ lua_lock(L); close_state(L); diff --git a/libs/liblua/src/lstate.h b/libs/liblua/src/lstate.h index 9985545e47..56b3741000 100644 --- a/libs/liblua/src/lstate.h +++ b/libs/liblua/src/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.132 2016/10/19 12:31:42 roberto Exp roberto $ +** $Id: lstate.h,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ @@ -26,6 +26,24 @@ ** 'tobefnz': all objects ready to be finalized; ** 'fixedgc': all objects that are not to be collected (currently ** only small strings, such as reserved words). +** +** Moreover, there is another set of lists that control gray objects. +** These lists are linked by fields 'gclist'. (All objects that +** can become gray have such a field. The field is not the same +** in all objects, but it always has this name.) Any gray object +** must belong to one of these lists, and all objects in these lists +** must be gray: +** +** 'gray': regular gray objects, still waiting to be visited. +** 'grayagain': objects that must be revisited at the atomic phase. +** That includes +** - black objects got in a write barrier; +** - all kinds of weak tables during propagation phase; +** - all threads. +** 'weak': tables with weak values to be cleared; +** 'ephemeron': ephemeron tables with white->white entries; +** 'allweak': tables with weak keys and/or weak values to be cleared. +** The last three lists are used only during the atomic phase. */ diff --git a/libs/liblua/src/lstring.c b/libs/liblua/src/lstring.c index fc9eb220e7..6257f211d9 100644 --- a/libs/liblua/src/lstring.c +++ b/libs/liblua/src/lstring.c @@ -1,5 +1,5 @@ /* -** $Id: lstring.c,v 2.55 2015/11/03 15:36:01 roberto Exp roberto $ +** $Id: lstring.c,v 2.56.1.1 2017/04/19 17:20:42 roberto Exp $ ** String table (keeps all strings handled by Lua) ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lstring.h b/libs/liblua/src/lstring.h index 6351003af8..d612abd333 100644 --- a/libs/liblua/src/lstring.h +++ b/libs/liblua/src/lstring.h @@ -1,5 +1,5 @@ /* -** $Id: lstring.h,v 1.60 2015/09/08 15:41:05 roberto Exp roberto $ +** $Id: lstring.h,v 1.61.1.1 2017/04/19 17:20:42 roberto Exp $ ** String table (keep all strings handled by Lua) ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lstrlib.c b/libs/liblua/src/lstrlib.c index 934b7db88c..b4bed7e93d 100644 --- a/libs/liblua/src/lstrlib.c +++ b/libs/liblua/src/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.253 2016/12/20 18:37:00 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.254.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -879,7 +879,7 @@ static int lua_number2strx (lua_State *L, char *buff, int sz, buff[i] = toupper(uchar(buff[i])); } else if (fmt[SIZELENMOD] != 'a') - luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented"); + return luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented"); return n; } @@ -1199,8 +1199,8 @@ static int getnum (const char **fmt, int df) { static int getnumlimit (Header *h, const char **fmt, int df) { int sz = getnum(fmt, df); if (sz > MAXINTSIZE || sz <= 0) - luaL_error(h->L, "integral size (%d) out of limits [1,%d]", - sz, MAXINTSIZE); + return luaL_error(h->L, "integral size (%d) out of limits [1,%d]", + sz, MAXINTSIZE); return sz; } diff --git a/libs/liblua/src/ltable.c b/libs/liblua/src/ltable.c index 92c165adac..ea4fe7fcb3 100644 --- a/libs/liblua/src/ltable.c +++ b/libs/liblua/src/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.117 2015/11/19 19:16:22 roberto Exp roberto $ +** $Id: ltable.c,v 2.118.1.4 2018/06/08 16:22:51 roberto Exp $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -223,7 +223,9 @@ static unsigned int computesizes (unsigned int nums[], unsigned int *pna) { unsigned int na = 0; /* number of elements to go to array part */ unsigned int optimal = 0; /* optimal size for array part */ /* loop while keys can fill more than half of total size */ - for (i = 0, twotoi = 1; *pna > twotoi / 2; i++, twotoi *= 2) { + for (i = 0, twotoi = 1; + twotoi > 0 && *pna > twotoi / 2; + i++, twotoi *= 2) { if (nums[i] > 0) { a += nums[i]; if (a > twotoi/2) { /* more than half elements present? */ @@ -330,17 +332,34 @@ static void setnodevector (lua_State *L, Table *t, unsigned int size) { } +typedef struct { + Table *t; + unsigned int nhsize; +} AuxsetnodeT; + + +static void auxsetnode (lua_State *L, void *ud) { + AuxsetnodeT *asn = cast(AuxsetnodeT *, ud); + setnodevector(L, asn->t, asn->nhsize); +} + + void luaH_resize (lua_State *L, Table *t, unsigned int nasize, unsigned int nhsize) { unsigned int i; int j; + AuxsetnodeT asn; unsigned int oldasize = t->sizearray; int oldhsize = allocsizenode(t); Node *nold = t->node; /* save old hash ... */ if (nasize > oldasize) /* array part must grow? */ setarrayvector(L, t, nasize); /* create new hash part with appropriate size */ - setnodevector(L, t, nhsize); + asn.t = t; asn.nhsize = nhsize; + if (luaD_rawrunprotected(L, auxsetnode, &asn) != LUA_OK) { /* mem. error? */ + setarrayvector(L, t, oldasize); /* array back to its original size */ + luaD_throw(L, LUA_ERRMEM); /* rethrow memory error */ + } if (nasize < oldasize) { /* array part must shrink? */ t->sizearray = nasize; /* re-insert elements from vanishing slice */ @@ -610,13 +629,13 @@ void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value) { } -static int unbound_search (Table *t, unsigned int j) { - unsigned int i = j; /* i is zero or a present index */ +static lua_Unsigned unbound_search (Table *t, lua_Unsigned j) { + lua_Unsigned i = j; /* i is zero or a present index */ j++; /* find 'i' and 'j' such that i is present and j is not */ while (!ttisnil(luaH_getint(t, j))) { i = j; - if (j > cast(unsigned int, MAX_INT)/2) { /* overflow? */ + if (j > l_castS2U(LUA_MAXINTEGER) / 2) { /* overflow? */ /* table was built with bad purposes: resort to linear search */ i = 1; while (!ttisnil(luaH_getint(t, i))) i++; @@ -626,7 +645,7 @@ static int unbound_search (Table *t, unsigned int j) { } /* now do a binary search between them */ while (j - i > 1) { - unsigned int m = (i+j)/2; + lua_Unsigned m = (i+j)/2; if (ttisnil(luaH_getint(t, m))) j = m; else i = m; } @@ -638,7 +657,7 @@ static int unbound_search (Table *t, unsigned int j) { ** Try to find a boundary in table 't'. A 'boundary' is an integer index ** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil). */ -int luaH_getn (Table *t) { +lua_Unsigned luaH_getn (Table *t) { unsigned int j = t->sizearray; if (j > 0 && ttisnil(&t->array[j - 1])) { /* there is a boundary in the array part: (binary) search for it */ diff --git a/libs/liblua/src/ltable.h b/libs/liblua/src/ltable.h index bd3543b530..92db0ac7bf 100644 --- a/libs/liblua/src/ltable.h +++ b/libs/liblua/src/ltable.h @@ -1,5 +1,5 @@ /* -** $Id: ltable.h,v 2.22 2016/11/07 12:38:35 roberto Exp roberto $ +** $Id: ltable.h,v 2.23.1.2 2018/05/24 19:39:05 roberto Exp $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -54,7 +54,7 @@ LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize, LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize); LUAI_FUNC void luaH_free (lua_State *L, Table *t); LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); -LUAI_FUNC int luaH_getn (Table *t); +LUAI_FUNC lua_Unsigned luaH_getn (Table *t); #if defined(LUA_DEBUG) diff --git a/libs/liblua/src/ltablib.c b/libs/liblua/src/ltablib.c index 588bf40d2f..c5349578ec 100644 --- a/libs/liblua/src/ltablib.c +++ b/libs/liblua/src/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.92 2016/02/08 12:55:19 roberto Exp roberto $ +** $Id: ltablib.c,v 1.93.1.1 2017/04/19 17:20:42 roberto Exp $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/ltm.c b/libs/liblua/src/ltm.c index b664dbed12..0e7c713214 100644 --- a/libs/liblua/src/ltm.c +++ b/libs/liblua/src/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 2.37 2016/02/26 19:20:15 roberto Exp roberto $ +** $Id: ltm.c,v 2.38.1.1 2017/04/19 17:39:34 roberto Exp $ ** Tag methods ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/ltm.h b/libs/liblua/src/ltm.h index 70569f82c9..8170688dae 100644 --- a/libs/liblua/src/ltm.h +++ b/libs/liblua/src/ltm.h @@ -1,5 +1,5 @@ /* -** $Id: ltm.h,v 2.21 2014/10/25 11:50:46 roberto Exp roberto $ +** $Id: ltm.h,v 2.22.1.1 2017/04/19 17:20:42 roberto Exp $ ** Tag methods ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lua.h b/libs/liblua/src/lua.h index fc4e23889d..c236e36095 100644 --- a/libs/liblua/src/lua.h +++ b/libs/liblua/src/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.331 2016/05/30 15:53:28 roberto Exp roberto $ +** $Id: lua.h,v 1.332.1.2 2018/06/13 16:58:17 roberto Exp $ ** Lua - A Scripting Language ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** See Copyright Notice at the end of this file @@ -19,11 +19,11 @@ #define LUA_VERSION_MAJOR "5" #define LUA_VERSION_MINOR "3" #define LUA_VERSION_NUM 503 -#define LUA_VERSION_RELEASE "4" +#define LUA_VERSION_RELEASE "5" #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE -#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2017 Lua.org, PUC-Rio" +#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2018 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" @@ -460,7 +460,7 @@ struct lua_Debug { /****************************************************************************** -* Copyright (C) 1994-2017 Lua.org, PUC-Rio. +* Copyright (C) 1994-2018 Lua.org, PUC-Rio. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the diff --git a/libs/liblua/src/luaconf.h b/libs/liblua/src/luaconf.h index 118f997a99..9eeeea69e2 100644 --- a/libs/liblua/src/luaconf.h +++ b/libs/liblua/src/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.258 2016/12/20 18:37:00 roberto Exp roberto $ +** $Id: luaconf.h,v 1.259.1.1 2017/04/19 17:29:57 roberto Exp $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -620,6 +620,13 @@ #endif +/* +@@ lua_pointer2str converts a pointer to a readable string in a +** non-specified way. +*/ +#define lua_pointer2str(buff,sz,p) l_sprintf(buff,sz,"%p",p) + + /* @@ lua_number2strx converts a float to an hexadecimal numeric string. ** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that. diff --git a/libs/liblua/src/lualib.h b/libs/liblua/src/lualib.h index ea07344463..f5304aa0dd 100644 --- a/libs/liblua/src/lualib.h +++ b/libs/liblua/src/lualib.h @@ -1,5 +1,5 @@ /* -** $Id: lualib.h,v 1.43 2011/12/08 12:11:37 roberto Exp roberto $ +** $Id: lualib.h,v 1.45.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lua standard libraries ** See Copyright Notice in lua.h */ @@ -11,6 +11,9 @@ #include "lua.h" +/* version suffix for environment variable names */ +#define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR + LUAMOD_API int (luaopen_base) (lua_State *L); diff --git a/libs/liblua/src/lundump.c b/libs/liblua/src/lundump.c index 13916bc1f1..7a67d75aaa 100644 --- a/libs/liblua/src/lundump.c +++ b/libs/liblua/src/lundump.c @@ -1,5 +1,5 @@ /* -** $Id: lundump.c,v 2.43 2015/09/17 15:51:05 roberto Exp roberto $ +** $Id: lundump.c,v 2.44.1.1 2017/04/19 17:20:42 roberto Exp $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lundump.h b/libs/liblua/src/lundump.h index bc9f99a29c..ce492d689c 100644 --- a/libs/liblua/src/lundump.h +++ b/libs/liblua/src/lundump.h @@ -1,5 +1,5 @@ /* -** $Id: lundump.h,v 1.44 2014/06/19 18:27:20 roberto Exp roberto $ +** $Id: lundump.h,v 1.45.1.1 2017/04/19 17:20:42 roberto Exp $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lutf8lib.c b/libs/liblua/src/lutf8lib.c index 6db6fd3762..10bd238a71 100644 --- a/libs/liblua/src/lutf8lib.c +++ b/libs/liblua/src/lutf8lib.c @@ -1,5 +1,5 @@ /* -** $Id: lutf8lib.c,v 1.15 2015/03/28 19:16:55 roberto Exp roberto $ +** $Id: lutf8lib.c,v 1.16.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard library for UTF-8 manipulation ** See Copyright Notice in lua.h */ @@ -171,7 +171,7 @@ static int byteoffset (lua_State *L) { } else { if (iscont(s + posi)) - luaL_error(L, "initial position is a continuation byte"); + return luaL_error(L, "initial position is a continuation byte"); if (n < 0) { while (n < 0 && posi > 0) { /* move back */ do { /* find beginning of previous character */ diff --git a/libs/liblua/src/lvm.c b/libs/liblua/src/lvm.c index 3709d77a4c..cc43d8714d 100644 --- a/libs/liblua/src/lvm.c +++ b/libs/liblua/src/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.267 2016/01/05 16:07:21 roberto Exp roberto $ +** $Id: lvm.c,v 2.268.1.1 2017/04/19 17:39:34 roberto Exp $ ** Lua virtual machine ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lvm.h b/libs/liblua/src/lvm.h index ca75a3386e..a8f954f04c 100644 --- a/libs/liblua/src/lvm.h +++ b/libs/liblua/src/lvm.h @@ -1,5 +1,5 @@ /* -** $Id: lvm.h,v 2.40 2016/01/05 16:07:21 roberto Exp roberto $ +** $Id: lvm.h,v 2.41.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lua virtual machine ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lzio.c b/libs/liblua/src/lzio.c index eb6151a0b2..6f79094410 100644 --- a/libs/liblua/src/lzio.c +++ b/libs/liblua/src/lzio.c @@ -1,5 +1,5 @@ /* -** $Id: lzio.c,v 1.36 2014/11/02 19:19:04 roberto Exp roberto $ +** $Id: lzio.c,v 1.37.1.1 2017/04/19 17:20:42 roberto Exp $ ** Buffered streams ** See Copyright Notice in lua.h */ diff --git a/libs/liblua/src/lzio.h b/libs/liblua/src/lzio.h index fb310b99c5..d897870815 100644 --- a/libs/liblua/src/lzio.h +++ b/libs/liblua/src/lzio.h @@ -1,5 +1,5 @@ /* -** $Id: lzio.h,v 1.30 2014/12/19 17:26:14 roberto Exp roberto $ +** $Id: lzio.h,v 1.31.1.1 2017/04/19 17:20:42 roberto Exp $ ** Buffered streams ** See Copyright Notice in lua.h */ -- cgit v1.2.3