summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2018-10-24 11:09:17 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2018-10-24 11:16:25 -0400
commit20b98f6fd0e5916bffe9561ebd324acdfbabf61a (patch)
treec1a83038efbcbc68b55659100359061ca094c445
parentdf4cb9bafc66c3d88945b70389e0cb87cbcecf15 (diff)
downloadrockbox-20b98f6fd0e5916bffe9561ebd324acdfbabf61a.tar.gz
rockbox-20b98f6fd0e5916bffe9561ebd324acdfbabf61a.zip
Lua fix create_numbered_filename
I didn't realize that some devices used the *num variable this fixes that oversight Change-Id: I2ecd6f475bebdd6ce745b360be3762a069bfc2b1
-rw-r--r--apps/plugins/lua/rocklib.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index 64394b8728..3f85da97a7 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -383,9 +383,12 @@ RB_WRAP(create_numbered_filename)
const char * path = luaL_checkstring(L, 1);
const char * prefix = luaL_checkstring(L, 2);
const char * suffix = luaL_checkstring(L, 3);
- int numberlen = luaL_optint(L, 4, -1);
+ int numberlen = luaL_checkint(L, 4);
+ int num = luaL_optint(L, 5, -1);
+ (void) num;
- if(rb->create_numbered_filename(buffer, path, prefix, suffix, numberlen))
+ if(rb->create_numbered_filename(buffer, path, prefix, suffix, numberlen
+ IF_CNFN_NUM_(, &num)))
{
luaL_addstring(&b, buffer);
luaL_pushresult(&b);