commit d909291b0ced891bb5c3de248172d23665452856
parent b30522463ae38015cfbc5c78ad7ae64591c73ac5
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 25 May 2020 18:52:09 +0200
tweaks: rename one of the flag symbols, to be clearer
I kept understanding 'BACKUP_FILE' as a noun instead of as an imperative.
Diffstat:
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -1594,7 +1594,7 @@ bool write_file(const char *name, FILE *thefile, bool tmp,
* isn't temporary. Furthermore, if we aren't appending, prepending, or
* writing a selection, we back up only if the file has not been modified
* by someone else since nano opened it. */
- if (ISSET(BACKUP_FILE) && is_existing_file && openfile->current_stat &&
+ if (ISSET(MAKE_BACKUP) && is_existing_file && openfile->current_stat &&
(method != OVERWRITE || openfile->mark ||
openfile->current_stat->st_mtime == st.st_mtime)) {
static struct timespec filetime[2];
@@ -2037,7 +2037,7 @@ int do_writeout(bool exiting, bool withprompt)
formatstr = (openfile->fmt == DOS_FILE) ? _(" [DOS Format]") :
(openfile->fmt == MAC_FILE) ? _(" [Mac Format]") : "";
- backupstr = ISSET(BACKUP_FILE) ? _(" [Backup]") : "";
+ backupstr = ISSET(MAKE_BACKUP) ? _(" [Backup]") : "";
/* When the mark is on, offer to write the selection to disk, but
* not when in restricted mode, because it would allow writing to
@@ -2108,7 +2108,7 @@ int do_writeout(bool exiting, bool withprompt)
openfile->fmt = (openfile->fmt == MAC_FILE) ? NIX_FILE : MAC_FILE;
continue;
} else if (func == backup_file_void) {
- TOGGLE(BACKUP_FILE);
+ TOGGLE(MAKE_BACKUP);
continue;
} else if (func == prepend_void) {
method = (method == PREPEND) ? OVERWRITE : PREPEND;
diff --git a/src/nano.c b/src/nano.c
@@ -1799,7 +1799,7 @@ int main(int argc, char **argv)
SET(SMART_HOME);
break;
case 'B':
- SET(BACKUP_FILE);
+ SET(MAKE_BACKUP);
break;
case 'C':
backup_dir = mallocstrcpy(backup_dir, optarg);
@@ -2137,7 +2137,7 @@ int main(int argc, char **argv)
/* When in restricted mode, disable backups, suspending, and history files,
* since they allow writing to files not specified on the command line. */
if (ISSET(RESTRICTED)) {
- UNSET(BACKUP_FILE);
+ UNSET(MAKE_BACKUP);
UNSET(SUSPENDABLE);
#ifdef ENABLE_NANORC
UNSET(HISTORYLOG);
diff --git a/src/nano.h b/src/nano.h
@@ -510,7 +510,7 @@ enum
REBIND_DELETE,
RAW_SEQUENCES,
NO_CONVERT,
- BACKUP_FILE,
+ MAKE_BACKUP,
INSECURE_BACKUP,
NO_SYNTAX,
PRESERVE,
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -100,7 +100,7 @@ static const rcoption rcopts[] = {
{"allow_insecure_backup", INSECURE_BACKUP},
{"atblanks", AT_BLANKS},
{"autoindent", AUTOINDENT},
- {"backup", BACKUP_FILE},
+ {"backup", MAKE_BACKUP},
{"backupdir", 0},
{"casesensitive", CASE_SENSITIVE},
{"cutfromcursor", CUT_FROM_CURSOR},