# HG changeset patch # User jbe # Date 1452621437 -3600 # Node ID c343ce9092ee66d9cf7ee7541503183cb5826f69 # Parent 4ae9850d695492b2bdf6e735173268f94852238c Added downward-compatibility code for mondelefant.connect{engine='postgresql', ...} call diff -r 4ae9850d6954 -r c343ce9092ee libraries/mondelefant/mondelefant.lua --- a/libraries/mondelefant/mondelefant.lua Tue Jan 12 18:39:32 2016 +0100 +++ b/libraries/mondelefant/mondelefant.lua Tue Jan 12 18:57:17 2016 +0100 @@ -38,6 +38,24 @@ setfenv(1, _M) end +-- TODO: remove following downward-compatibility code +-- for mondelefant.connect{...} function: + +do + local original_connect_function = connect + function connect(args) + if args.engine == "postgresql" then + local newargs = {} + for k, v in pairs(args) do + if k ~= "engine" then newargs[k] = v end + end + return original_connect_function(newargs) + else + return original_connect_function(args) + end + end +end + --------------- diff -r 4ae9850d6954 -r c343ce9092ee libraries/mondelefant/mondelefant_native.c --- a/libraries/mondelefant/mondelefant_native.c Tue Jan 12 18:39:32 2016 +0100 +++ b/libraries/mondelefant/mondelefant_native.c Tue Jan 12 18:57:17 2016 +0100 @@ -228,7 +228,6 @@ luaL_buffinit(L, &buf); while (lua_pushvalue(L, 2), lua_next(L, 1)) { luaL_argcheck(L, lua_isstring(L, -2), 1, "key in table is not a string"); - luaL_argcheck(L, lua_isstring(L, -1), 1, "value in table is not a string"); value = luaL_tolstring(L, -1, &value_len); lua_replace(L, 3); lua_pop(L, 1);