1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Refuse to load broken configs on irssi start

By temporarily raising the fatal log level to critical during irssi
start-up, we make it fail when the config file is broken. This is then
re-set so that /reload of a broken config file will not crash irssi and
just report the errors and gracefully continue instead.
This commit is contained in:
Ailin Nemui 2015-02-17 09:44:33 +01:00
parent af6b789d2a
commit 1e4f7e6324

View File

@ -310,6 +310,7 @@ int main(int argc, char **argv)
{ "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Display irssi version", NULL },
{ NULL }
};
int loglev;
#ifdef USE_GC
g_mem_set_vtable(&gc_mem_table);
@ -352,6 +353,7 @@ int main(int argc, char **argv)
you have to call setlocale(LC_ALL, "") */
setlocale(LC_ALL, "");
loglev = g_log_set_always_fatal(G_LOG_FATAL_MASK | G_LOG_LEVEL_CRITICAL);
textui_init();
if (!dummy && !term_init()) {
@ -360,6 +362,7 @@ int main(int argc, char **argv)
return 1;
}
g_log_set_always_fatal(loglev);
textui_finish_init();
main_loop = g_main_new(TRUE);