mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
Fix building without BUILD_OLD_CONFIG
This commit is contained in:
parent
5f76f847dd
commit
529392aef0
15
src/conky.cc
15
src/conky.cc
@ -2655,16 +2655,23 @@ void load_config_file()
|
|||||||
#endif
|
#endif
|
||||||
l.loadfile(current_config.c_str());
|
l.loadfile(current_config.c_str());
|
||||||
}
|
}
|
||||||
#ifdef BUILD_OLD_CONFIG
|
|
||||||
catch(lua::syntax_error &e) {
|
catch(lua::syntax_error &e) {
|
||||||
NORM_ERR(_("Syntax error (%s) while reading config file. "
|
#define SYNTAX_ERR_READ_CONF "Syntax error (%s) while reading config file. "
|
||||||
"Assuming it's in old syntax and attempting conversion."), e.what());
|
#ifdef BUILD_OLD_CONFIG
|
||||||
|
NORM_ERR(_(SYNTAX_ERR_READ_CONF));
|
||||||
|
NORM_ERR(_("Assuming it's in old syntax and attempting conversion."), e.what());
|
||||||
// the strchr thingy skips the first line (#! /usr/bin/lua)
|
// the strchr thingy skips the first line (#! /usr/bin/lua)
|
||||||
l.loadstring(strchr(convertconf, '\n'));
|
l.loadstring(strchr(convertconf, '\n'));
|
||||||
l.pushstring(current_config.c_str());
|
l.pushstring(current_config.c_str());
|
||||||
l.call(1, 1);
|
l.call(1, 1);
|
||||||
}
|
#else
|
||||||
|
char *syntaxerr;
|
||||||
|
asprintf(&syntaxerr, _(SYNTAX_ERR_READ_CONF), e.what());
|
||||||
|
std::string syntaxerrobj(syntaxerr);
|
||||||
|
free(syntaxerr);
|
||||||
|
throw conky::error(syntaxerrobj);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
l.call(0, 0);
|
l.call(0, 0);
|
||||||
|
|
||||||
l.getglobal("conky");
|
l.getglobal("conky");
|
||||||
|
Loading…
Reference in New Issue
Block a user