]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: hlua_fcn: fix Patref:set() force parameter
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 29 Nov 2024 06:33:51 +0000 (07:33 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 29 Nov 2024 06:39:38 +0000 (07:39 +0100)
commit4e52438c0ba3603a597e9d81ea7737071fe8acc3
tree0467006ede9b1c0022ac320bf403a4fc4c74351c
parente5acb031373a041269a8bb47a26a9f6c593b91f0
BUG/MINOR: hlua_fcn: fix Patref:set() force parameter

Patref:set(key, val[, force]) takes optional "force" parameter (defaults
to false) to force the entry to be created if it doesn't already exist

To retrieve the value, lua_tointeger() was used in place of
lua_toboolean(), and because of that force is not enabled if "true"
is passed as parameter (only numbers were recognized) despite the
documentation mentioning that "force" is a boolean.

To fix the issue, we replace lua_tointeger by lua_toboolean.

Also, the doc was updated to rename "bool" to "boolean" for the "force"
parameter to stay consistent with historical naming in the file.

No backport needed unless 9ee37de5c ("MINOR: hlua_fcn: add Patref:set()")
is.
doc/lua-api/index.rst
src/hlua_fcn.c