nano

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

commit e1a6f58da6c9b14132f2a92a6e60f67e11474c83
parent 0ae80ce362712fe2d42cfd2d4f7cae1713f3143b
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 10 Jan 2019 20:29:04 +0100

startup: check that a backup directory is valid also when backups are off

When the user switches backups on later (with M-B in the ^O menu),
the specified folder should have been checked for validity.

This fixes https://savannah.gnu.org/bugs/?55423.

Bug existed since the check for a valid backup directory was introduced
in version 2.8.7, commit 751e7f0f.

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

diff --git a/src/nano.c b/src/nano.c @@ -2449,9 +2449,9 @@ int main(int argc, char **argv) #endif /* ENABLE_HISTORIES */ #ifndef NANO_TINY - /* If backups are enabled and a backup directory was specified, make sure - * the path exists and is a folder, so backup files can be saved there. */ - if (ISSET(BACKUP_FILE) && backup_dir != NULL) + /* If a backup directory was specified and we're not in restricted mode, + * verify it is an existing folder, so backup files can be saved there. */ + if (backup_dir != NULL && !ISSET(RESTRICTED)) init_backup_dir(); #endif #ifdef ENABLE_OPERATINGDIR