linter: do not mess up the input stream when the linter command is empty

Instead simply say that no linter is defined.

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

Bug existed since version 5.5, commit bc368133, but before
that commit nano would crash on an empty linter command.
This commit is contained in:
Benno Schulenberg 2024-01-24 16:14:23 +01:00
parent 367f84b0ec
commit 88c8da143f
1 changed files with 1 additions and 1 deletions

View File

@ -2586,7 +2586,7 @@ void do_linter(void)
if (in_restricted_mode())
return;
if (!openfile->syntax || !openfile->syntax->linter) {
if (!openfile->syntax || !openfile->syntax->linter || !*openfile->syntax->linter) {
statusline(AHEM, _("No linter is defined for this type of file"));
return;
}