From 590601d810b5a810f87aa9b37ed31d8e7e43063d Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 5 Jan 2022 00:30:43 -0600 Subject: fix bug with leading slashes --- src/bindings.c | 4 ++-- src/lua-script/script.h | 2 +- src/lua-script/script.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bindings.c b/src/bindings.c index 45abf6a..1a73fb0 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -58,8 +58,8 @@ int markdown(lua_State *L) unsigned int md_flags = MD_FLAG_TABLES | MD_FLAG_STRIKETHROUGH | MD_FLAG_UNDERLINE; struct concat_buffer data; - data.buf = malloc(128 * sizeof(char)); - data.size = 128 * sizeof(char); + data.buf = malloc(2048 * sizeof(char)); + data.size = 2048 * sizeof(char); data.index = 0; data.ok = true; diff --git a/src/lua-script/script.h b/src/lua-script/script.h index 3789738..1ba2e4b 100644 --- a/src/lua-script/script.h +++ b/src/lua-script/script.h @@ -529,7 +529,7 @@ const char *argent_script = "\n" " function process(directory, parent)\n" " local directory = add_end_slash(directory) or ''\n" - " local parent = add_end_slash(parent) or ''\n" + " local parent = parent or ''\n" " local dirs, files = argent.scanDirectory(argent.config.site_directory..parent..directory)\n" " for _, file in ipairs(files) do\n" " process_file(file, parent..directory)\n" diff --git a/src/lua-script/script.lua b/src/lua-script/script.lua index f372b2b..2e896ae 100644 --- a/src/lua-script/script.lua +++ b/src/lua-script/script.lua @@ -528,7 +528,7 @@ return function(config) function process(directory, parent) local directory = add_end_slash(directory) or '' - local parent = add_end_slash(parent) or '' + local parent = parent or '' local dirs, files = argent.scanDirectory(argent.config.site_directory..parent..directory) for _, file in ipairs(files) do process_file(file, parent..directory) -- cgit v1.2.1