diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-10-29 14:15:00 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-10-29 14:15:00 +0100 |
commit | cd4528ae07da53abeb0c0b349634edb508b6d28e (patch) | |
tree | 6deadbcb373da4b15f362edc5f7ef4657a4f005c | |
parent | d1bb0a981a0074d136d16f1aabba9129eac4b59e (diff) | |
download | sciteco-cd4528ae07da53abeb0c0b349634edb508b6d28e.tar.gz |
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.
-rw-r--r-- | src/interface-curses/interface.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 @@ -1062,6 +1062,13 @@ 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, * so resizing makes no sense. |