Fix segfault when running hooks in non-interactive mode
Do not run wins_prepare_external() and wins_unprepare_external() before and after running hooks in non-interactive mode. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
6ebcbd4d69
commit
2857bac971
@ -51,13 +51,17 @@ int run_hook(const char *name)
|
||||
if (!io_file_exists(hook_path))
|
||||
return 0;
|
||||
|
||||
wins_prepare_external();
|
||||
if (ui_mode == UI_CURSES)
|
||||
wins_prepare_external();
|
||||
|
||||
if ((pid = shell_exec(NULL, NULL, *arg, arg))) {
|
||||
ret = child_wait(NULL, NULL, pid);
|
||||
if (ret)
|
||||
press_any_key();
|
||||
}
|
||||
wins_unprepare_external();
|
||||
|
||||
if (ui_mode == UI_CURSES)
|
||||
wins_unprepare_external();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user