Author: cazfi Date: Mon Jan 12 22:29:47 2015 New Revision: 27650 URL: http://svn.gna.org/viewcvs/freeciv?rev=27650&view=rev Log: Backported luasql commit: Bug correction in the implementation of luaL_setfuncs
See patch #5675 Modified: trunk/dependencies/luasql/Version trunk/dependencies/luasql/src/luasql.c Modified: trunk/dependencies/luasql/Version URL: http://svn.gna.org/viewcvs/freeciv/trunk/dependencies/luasql/Version?rev=27650&r1=27649&r2=27650&view=diff ============================================================================== --- trunk/dependencies/luasql/Version (original) +++ trunk/dependencies/luasql/Version Mon Jan 12 22:29:47 2015 @@ -3,3 +3,4 @@ Following commits since the release have been backported: 7a099cfa0eb582bdf0e641bd8e869655ef8e7f02 Use _v2 APIs for SQLite version 3.6.13 and above. +c39aba1079dce7cc57d32ccc30bd67fef8ed4cb0 Bug correction in the implementation of luaL_setfuncs Modified: trunk/dependencies/luasql/src/luasql.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/dependencies/luasql/src/luasql.c?rev=27650&r1=27649&r2=27650&view=diff ============================================================================== --- trunk/dependencies/luasql/src/luasql.c (original) +++ trunk/dependencies/luasql/src/luasql.c Mon Jan 12 22:29:47 2015 @@ -67,12 +67,12 @@ ** Adapted from Lua 5.2.0 */ void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { - luaL_checkstack(L, nup, "too many upvalues"); + luaL_checkstack(L, nup+1, "too many upvalues"); for (; l->name != NULL; l++) { /* fill the table with given functions */ int i; + lua_pushstring(L, l->name); for (i = 0; i < nup; i++) /* copy upvalues to the top */ - lua_pushvalue(L, -nup); - lua_pushstring(L, l->name); + lua_pushvalue(L, -(nup + 1)); lua_pushcclosure(L, l->func, nup); /* closure with those upvalues */ lua_settable(L, -(nup + 3)); } _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits