nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 062b6691bb4b88fc3d0eb54b28bddfde59380e37
parent f4c958e81064af5db7dac524556a18b1ad283624
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 30 Sep 2018 13:11:43 +0200

tweaks: drop the checking of two flags that can no longer be toggled

Also, remove a superfluous condition, and swap two others.

Diffstat:
Msrc/nano.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1369,8 +1369,7 @@ void do_toggle(int flag) { bool enabled; - if (ISSET(RESTRICTED) && (flag == SUSPEND || flag == MULTIBUFFER || - flag == BACKUP_FILE || flag == NO_COLOR_SYNTAX)) { + if (ISSET(RESTRICTED) && (flag == SUSPEND || flag == NO_COLOR_SYNTAX)) { show_restricted_warning(); return; } @@ -2456,7 +2455,7 @@ int main(int argc, char **argv) /* If backups are enabled and a backup directory was specified and * we're not in restricted mode, make sure the path exists and is * a directory, so that backup files can be saved there. */ - if (ISSET(BACKUP_FILE) && backup_dir != NULL && !ISSET(RESTRICTED)) + if (ISSET(BACKUP_FILE) && backup_dir != NULL) init_backup_dir(); #endif @@ -2496,8 +2495,9 @@ int main(int argc, char **argv) * does (unless we're using restricted mode, in which case spell * checking is disabled, since it would allow reading from or * writing to files not specified on the command line). */ - if (!ISSET(RESTRICTED) && alt_speller == NULL) { + if (alt_speller == NULL && !ISSET(RESTRICTED)) { const char *spellenv = getenv("SPELL"); + if (spellenv != NULL) alt_speller = mallocstrcpy(NULL, spellenv); }