Set the conffile value before executing the code
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
e40bfedd30
commit
bf56ae79dd
14
luaa.c
14
luaa.c
|
@ -639,13 +639,17 @@ luaA_loadrc(const char *confpath, bool run)
|
||||||
{
|
{
|
||||||
if(run)
|
if(run)
|
||||||
{
|
{
|
||||||
if(lua_pcall(globalconf.L, 0, LUA_MULTRET, 0))
|
/* Set the conffile right now so it can be used inside the
|
||||||
fprintf(stderr, "%s\n", lua_tostring(globalconf.L, -1));
|
* configuration file. */
|
||||||
else
|
|
||||||
{
|
|
||||||
conffile = a_strdup(confpath);
|
conffile = a_strdup(confpath);
|
||||||
return true;
|
if(lua_pcall(globalconf.L, 0, LUA_MULTRET, 0))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s\n", lua_tostring(globalconf.L, -1));
|
||||||
|
/* An error happened, so reset this. */
|
||||||
|
conffile = NULL;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue