webmcp
changeset 421:c343ce9092ee
Added downward-compatibility code for mondelefant.connect{engine='postgresql', ...} call
author | jbe |
---|---|
date | Tue Jan 12 18:57:17 2016 +0100 (2016-01-12) |
parents | 4ae9850d6954 |
children | 837690e70cae |
files | libraries/mondelefant/mondelefant.lua libraries/mondelefant/mondelefant_native.c |
line diff
1.1 --- a/libraries/mondelefant/mondelefant.lua Tue Jan 12 18:39:32 2016 +0100 1.2 +++ b/libraries/mondelefant/mondelefant.lua Tue Jan 12 18:57:17 2016 +0100 1.3 @@ -38,6 +38,24 @@ 1.4 setfenv(1, _M) 1.5 end 1.6 1.7 +-- TODO: remove following downward-compatibility code 1.8 +-- for mondelefant.connect{...} function: 1.9 + 1.10 +do 1.11 + local original_connect_function = connect 1.12 + function connect(args) 1.13 + if args.engine == "postgresql" then 1.14 + local newargs = {} 1.15 + for k, v in pairs(args) do 1.16 + if k ~= "engine" then newargs[k] = v end 1.17 + end 1.18 + return original_connect_function(newargs) 1.19 + else 1.20 + return original_connect_function(args) 1.21 + end 1.22 + end 1.23 +end 1.24 + 1.25 1.26 1.27 ---------------
2.1 --- a/libraries/mondelefant/mondelefant_native.c Tue Jan 12 18:39:32 2016 +0100 2.2 +++ b/libraries/mondelefant/mondelefant_native.c Tue Jan 12 18:57:17 2016 +0100 2.3 @@ -228,7 +228,6 @@ 2.4 luaL_buffinit(L, &buf); 2.5 while (lua_pushvalue(L, 2), lua_next(L, 1)) { 2.6 luaL_argcheck(L, lua_isstring(L, -2), 1, "key in table is not a string"); 2.7 - luaL_argcheck(L, lua_isstring(L, -1), 1, "value in table is not a string"); 2.8 value = luaL_tolstring(L, -1, &value_len); 2.9 lua_replace(L, 3); 2.10 lua_pop(L, 1);