1
1

don't bother initializing the backup directory or reading $SPELL for the

alternative spell checker if we're in restricted mode, since both
backups and spell checking are disabled then


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1777 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
David Lawrence Ramsey 2004-05-28 23:45:25 +00:00
родитель 3aedb36e68
Коммит dd7cc7230e
2 изменённых файлов: 15 добавлений и 7 удалений

Просмотреть файл

@ -208,8 +208,12 @@ 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)
- Don't initialize the backup directory if we're in restricted
mode, since backups are disabled then. (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)
one from the command line and/or rcfile, as Pico does. Don't
do this if we're in restricted mode, since spell checking is
disabled then. (DLR)
- nano.h:
- Since REGEXP_COMPILED is only used in search.c, convert it
from a flag to a static int there. (DLR)

Просмотреть файл

@ -3367,14 +3367,17 @@ int main(int argc, char *argv[])
#endif
#ifndef NANO_SMALL
/* Set up the backup directory. This entails making sure it exists
* and is a directory, so that backup files will be saved there. */
init_backup_dir();
/* Set up the backup directory (unless we're using restricted mode,
* in which case backups are disabled). This entails making sure it
* exists and is a directory, so that backup files will be saved
* there. */
if (!ISSET(RESTRICTED))
init_backup_dir();
#endif
#ifndef DISABLE_OPERATINGDIR
/* Set up the operating directory. This entails chdir()ing there,
so that file reads and writes will be based there. */
* so that file reads and writes will be based there. */
init_operating_dir();
#endif
@ -3390,8 +3393,9 @@ int main(int argc, char *argv[])
#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) {
* does (unless we're using restricted mode, in which case spell
* checking is disabled). */
if (!ISSET(RESTRICTED) && alt_speller == NULL) {
char *spellenv = getenv("SPELL");
if (spellenv != NULL)
alt_speller = mallocstrcpy(NULL, spellenv);