mirror of
https://github.com/irssi/irssi.git
synced 2024-10-27 05:20:20 -04: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:
parent
af6b789d2a
commit
1e4f7e6324
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user