nano

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

commit 367f84b0ecfcba26dbd3161d624ce97eaa7e529e
parent 1a3ef7e497ccd5483dd537b17de07b150ebfa252
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 24 Jan 2024 11:47:39 +0100

formatter: do not crash when the formatter command is empty

Instead simply say that no formatter is defined.

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

Bug existed since version 4.6, since the formatter was reintroduced.

Diffstat:
Msrc/text.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/text.c b/src/text.c @@ -2927,7 +2927,7 @@ void do_formatter(void) if (in_restricted_mode()) return; - if (!openfile->syntax || !openfile->syntax->formatter) { + if (!openfile->syntax || !openfile->syntax->formatter || !*openfile->syntax->formatter) { statusline(AHEM, _("No formatter is defined for this type of file")); return; }