tweaks: rename one of the flag symbols, to be clearer
I kept understanding 'BACKUP_FILE' as a noun instead of as an imperative.master
parent
b30522463a
commit
d909291b0c
|
@ -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
|
* 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
|
* writing a selection, we back up only if the file has not been modified
|
||||||
* by someone else since nano opened it. */
|
* 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 ||
|
(method != OVERWRITE || openfile->mark ||
|
||||||
openfile->current_stat->st_mtime == st.st_mtime)) {
|
openfile->current_stat->st_mtime == st.st_mtime)) {
|
||||||
static struct timespec filetime[2];
|
static struct timespec filetime[2];
|
||||||
|
@ -2037,7 +2037,7 @@ int do_writeout(bool exiting, bool withprompt)
|
||||||
|
|
||||||
formatstr = (openfile->fmt == DOS_FILE) ? _(" [DOS Format]") :
|
formatstr = (openfile->fmt == DOS_FILE) ? _(" [DOS Format]") :
|
||||||
(openfile->fmt == MAC_FILE) ? _(" [Mac 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
|
/* When the mark is on, offer to write the selection to disk, but
|
||||||
* not when in restricted mode, because it would allow writing to
|
* 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;
|
openfile->fmt = (openfile->fmt == MAC_FILE) ? NIX_FILE : MAC_FILE;
|
||||||
continue;
|
continue;
|
||||||
} else if (func == backup_file_void) {
|
} else if (func == backup_file_void) {
|
||||||
TOGGLE(BACKUP_FILE);
|
TOGGLE(MAKE_BACKUP);
|
||||||
continue;
|
continue;
|
||||||
} else if (func == prepend_void) {
|
} else if (func == prepend_void) {
|
||||||
method = (method == PREPEND) ? OVERWRITE : PREPEND;
|
method = (method == PREPEND) ? OVERWRITE : PREPEND;
|
||||||
|
|
|
@ -1799,7 +1799,7 @@ int main(int argc, char **argv)
|
||||||
SET(SMART_HOME);
|
SET(SMART_HOME);
|
||||||
break;
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
SET(BACKUP_FILE);
|
SET(MAKE_BACKUP);
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
backup_dir = mallocstrcpy(backup_dir, optarg);
|
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,
|
/* When in restricted mode, disable backups, suspending, and history files,
|
||||||
* since they allow writing to files not specified on the command line. */
|
* since they allow writing to files not specified on the command line. */
|
||||||
if (ISSET(RESTRICTED)) {
|
if (ISSET(RESTRICTED)) {
|
||||||
UNSET(BACKUP_FILE);
|
UNSET(MAKE_BACKUP);
|
||||||
UNSET(SUSPENDABLE);
|
UNSET(SUSPENDABLE);
|
||||||
#ifdef ENABLE_NANORC
|
#ifdef ENABLE_NANORC
|
||||||
UNSET(HISTORYLOG);
|
UNSET(HISTORYLOG);
|
||||||
|
|
|
@ -510,7 +510,7 @@ enum
|
||||||
REBIND_DELETE,
|
REBIND_DELETE,
|
||||||
RAW_SEQUENCES,
|
RAW_SEQUENCES,
|
||||||
NO_CONVERT,
|
NO_CONVERT,
|
||||||
BACKUP_FILE,
|
MAKE_BACKUP,
|
||||||
INSECURE_BACKUP,
|
INSECURE_BACKUP,
|
||||||
NO_SYNTAX,
|
NO_SYNTAX,
|
||||||
PRESERVE,
|
PRESERVE,
|
||||||
|
|
|
@ -100,7 +100,7 @@ static const rcoption rcopts[] = {
|
||||||
{"allow_insecure_backup", INSECURE_BACKUP},
|
{"allow_insecure_backup", INSECURE_BACKUP},
|
||||||
{"atblanks", AT_BLANKS},
|
{"atblanks", AT_BLANKS},
|
||||||
{"autoindent", AUTOINDENT},
|
{"autoindent", AUTOINDENT},
|
||||||
{"backup", BACKUP_FILE},
|
{"backup", MAKE_BACKUP},
|
||||||
{"backupdir", 0},
|
{"backupdir", 0},
|
||||||
{"casesensitive", CASE_SENSITIVE},
|
{"casesensitive", CASE_SENSITIVE},
|
||||||
{"cutfromcursor", CUT_FROM_CURSOR},
|
{"cutfromcursor", CUT_FROM_CURSOR},
|
||||||
|
|
Loading…
Reference in New Issue