util/lua-common: fix SCFileInfo bug & doc comment

The callback for FileInfo was returning the wrong value, resulting
in loss of some tuple values for one calling SCFileInfo in a script.

The documentation comment wasn't mentioning the sha items that are
pushed.
pull/6383/head
Juliana Fajardini 4 years ago committed by Victor Julien
parent 8b53468d32
commit 1315cb793b

@ -750,7 +750,8 @@ static int LuaCallbackLogError(lua_State *luastate)
* \retval cnt number of data items placed on the stack
*
* Places: fileid (number), txid (number), name (string),
* size (number), magic (string), md5 in hex (string)
* size (number), magic (string), md5 in hex (string),
* sha1 (string), sha256 (string)
*/
static int LuaCallbackFileInfoPushToStackFromFile(lua_State *luastate, const File *file)
{
@ -803,7 +804,7 @@ static int LuaCallbackFileInfoPushToStackFromFile(lua_State *luastate, const Fil
lua_pushstring(luastate, md5ptr);
lua_pushstring(luastate, sha1ptr);
lua_pushstring(luastate, sha256ptr);
return 6;
return 8;
}
/** \internal

Loading…
Cancel
Save