From 735a608e80eb80a85e906a0737166dfff8796ebe Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 11 Jan 2021 19:15:35 +0100 Subject: [PATCH] speller: strip leading whitespace from command, to avoid a sneaky crash This completes the fix for https://savannah.gnu.org/bugs/?59855. --- src/nano.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nano.c b/src/nano.c index a4f051c0..53326d2a 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2166,6 +2166,9 @@ int main(int argc, char **argv) free(alt_speller); alt_speller = alt_speller_cmdline; } + /* Strip leading whitespace from the speller command, if any. */ + while (alt_speller && *alt_speller && isblank(*alt_speller)) + alt_speller++; #endif /* If an rcfile undid the default settings, copy it to the new flags. */