diff --git a/ChangeLog b/ChangeLog index b1450cd1b8a14bf8996ea40c484d283b33a832a6..d78ec88006ee247924ac750cb9aaeb060290ce63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -208,6 +208,8 @@ CVS code - after the terminal is properly set up, so that we can restore it easily after a resize. (DLR) - Add missing cast to char when calling do_char(). (DLR) + - Check $SPELL for an alternative spell checker if we didn't get + one from the command line and/or rcfile, as Pico does. (DLR) - nano.h: - Since REGEXP_COMPILED is only used in search.c, convert it from a flag to a static int there. (DLR) diff --git a/src/nano.c b/src/nano.c index b136b9491b5cc174ffd66b86899cbfb9000d255f..1aebe419be1c11cda08eaa1682bb5eefd8062ce8 100644 --- a/src/nano.c +++ b/src/nano.c @@ -3387,6 +3387,17 @@ int main(int argc, char *argv[]) #endif #endif /* !DISABLE_JUSTIFY */ +#ifndef DISABLE_SPELLER + /* If we don't have an alternative spell checker after reading the + * command line and/or rcfile, check $SPELL for one, as Pico + * does. */ + if (alt_speller == NULL) { + char *spellenv = getenv("SPELL"); + if (spellenv != NULL) + alt_speller = mallocstrcpy(NULL, spellenv); + } +#endif + if (tabsize == -1) tabsize = 8;