aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-10-29 14:15:00 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-10-29 14:15:00 +0100
commitcd4528ae07da53abeb0c0b349634edb508b6d28e (patch)
tree6deadbcb373da4b15f362edc5f7ef4657a4f005c /src
parentd1bb0a981a0074d136d16f1aabba9129eac4b59e (diff)
downloadsciteco-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.
Diffstat (limited to 'src')
-rw-r--r--src/interface-curses/interface.c7
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.