From cd4528ae07da53abeb0c0b349634edb508b6d28e Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 29 Oct 2024 14:15:00 +0100 Subject: teco_interface_cmdline_update() now protects against batch mode (--fake-cmdline) * Fixes the test suite on PDcurses/Win32 and therefore CI builds. * Should be necessary on UNIX as well since later on, we would access cmdline_window, which is not yet initialized. I didn't see any errors in Valgrind, though. --- src/interface-curses/interface.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index 95e86c9..b1fa88b 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -1061,6 +1061,13 @@ teco_interface_info_update_buffer(const teco_buffer_t *buffer) void teco_interface_cmdline_update(const teco_cmdline_t *cmdline) { + /* + * Especially important on PDCurses, which can crash + * in newpad() when run with --fake-cmdline. + */ + if (!teco_interface.cmdline_window) /* batch mode */ + return; + /* * Replace entire pre-formatted command-line. * We don't know if it is similar to the last one, -- cgit v1.2.3