Commit dd7cc723 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

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
No related merge requests found
Showing with 15 additions and 7 deletions
+15 -7
...@@ -208,8 +208,12 @@ CVS code - ...@@ -208,8 +208,12 @@ CVS code -
after the terminal is properly set up, so that we can restore after the terminal is properly set up, so that we can restore
it easily after a resize. (DLR) it easily after a resize. (DLR)
- Add missing cast to char when calling do_char(). (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 - 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: - nano.h:
- Since REGEXP_COMPILED is only used in search.c, convert it - Since REGEXP_COMPILED is only used in search.c, convert it
from a flag to a static int there. (DLR) from a flag to a static int there. (DLR)
......
...@@ -3367,14 +3367,17 @@ int main(int argc, char *argv[]) ...@@ -3367,14 +3367,17 @@ int main(int argc, char *argv[])
#endif #endif
#ifndef NANO_SMALL #ifndef NANO_SMALL
/* Set up the backup directory. This entails making sure it exists /* Set up the backup directory (unless we're using restricted mode,
* and is a directory, so that backup files will be saved there. */ * in which case backups are disabled). This entails making sure it
init_backup_dir(); * exists and is a directory, so that backup files will be saved
* there. */
if (!ISSET(RESTRICTED))
init_backup_dir();
#endif #endif
#ifndef DISABLE_OPERATINGDIR #ifndef DISABLE_OPERATINGDIR
/* Set up the operating directory. This entails chdir()ing there, /* 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(); init_operating_dir();
#endif #endif
...@@ -3390,8 +3393,9 @@ int main(int argc, char *argv[]) ...@@ -3390,8 +3393,9 @@ int main(int argc, char *argv[])
#ifndef DISABLE_SPELLER #ifndef DISABLE_SPELLER
/* If we don't have an alternative spell checker after reading the /* If we don't have an alternative spell checker after reading the
* command line and/or rcfile, check $SPELL for one, as Pico * command line and/or rcfile, check $SPELL for one, as Pico
* does. */ * does (unless we're using restricted mode, in which case spell
if (alt_speller == NULL) { * checking is disabled). */
if (!ISSET(RESTRICTED) && alt_speller == NULL) {
char *spellenv = getenv("SPELL"); char *spellenv = getenv("SPELL");
if (spellenv != NULL) if (spellenv != NULL)
alt_speller = mallocstrcpy(NULL, spellenv); alt_speller = mallocstrcpy(NULL, spellenv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment