@@ -401,6 +401,7 @@ static int l_handler_wrapper(struct img_type *img, void *data) {
lua_Number result;
int l_func_ref;
int fdout;
+ const char* TMPDIR = get_tmpdir();
if (!gL || !img || !data) {
return -1;
@@ -44,9 +44,11 @@ static int start_lua_script(struct img_type *img, void *data)
int ret;
const char *fnname;
const char *output;
- char filename[64];
script_fn scriptfn;
lua_State *L = luaL_newstate(); /* opens Lua */
+ const char* TMPDIR = get_tmpdir();
+ char filename[MAX_IMAGE_FNAME + strlen(TMPDIR) +
+ strlen(SCRIPTS_DIR_SUFFIX) + 2];
if (!data)
return -1;
@@ -65,7 +67,8 @@ static int start_lua_script(struct img_type *img, void *data)
return 0;
}
- snprintf(filename, sizeof(filename), "%s%s", TMPDIR, img->fname);
+ snprintf(filename, sizeof(filename),
+ "%s%s%s", TMPDIR, SCRIPTS_DIR_SUFFIX, img->fname);
TRACE("Calling Lua %s", filename);
luaL_openlibs(L); /* opens the standard libraries */
Commit 7ce284c5401c64bcd54e469ce8a3f7639e28ed3a makes TMPDIR configurable. Fix the remaining sources that use the TMPDIR variable. Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Christian Storm <christian.storm@siemens.com> --- corelib/lua_interface.c | 1 + handlers/lua_scripthandler.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)