nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit fc01c5a10ee729d6f82e109890b593aef976205e
parent 896f174f9469ac250c6967beac30c627afed1e32
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 29 Jun 2021 12:51:44 +0200

feedback: when not in curses mode, just skip displaying any message

Calling die() could trigger another call of emergency_save(), which
could fail and cause another call to statusline(), which would call
die() again...  Spiralling until stack space runs out.

This fixes https://savannah.gnu.org/bugs/?60853.

Bug existed since version 5.1, commit 7942dab0.

Original report was in https://bugzilla.redhat.com/1976410.
Reported-by: Souptik Dutta Roy <duttaroy.souptik@gmail.com>

Diffstat:
Msrc/winio.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/winio.c b/src/winio.c @@ -2255,8 +2255,9 @@ void statusline(message_type importance, const char *msg, ...) UNSET(WHITESPACE_DISPLAY); + /* When not in curses mode, there is no status bar to display anything on. */ if (isendwin()) - die("Out of curses -- please report a bug\n"); + return; #endif /* Ignore a message with an importance that is lower than the last one. */