tweaks: condense two comments, and normalize the whitespace of a label
parent
3da4240229
commit
ce69d5be88
18
src/files.c
18
src/files.c
|
@ -1592,18 +1592,16 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
isactualfile = (stat(realname, &st) != -1);
|
isactualfile = (stat(realname, &st) != -1);
|
||||||
|
|
||||||
/* If we haven't stat()d this file before (say, the user just
|
/* If we haven't stat()d this file before (say, the user just specified
|
||||||
* specified it interactively), stat and save the value now,
|
* it interactively), stat and save the value now, or else we will chase
|
||||||
* or else we will chase null pointers when we do modtime checks,
|
* null pointers when we do modtime checks and such during backup. */
|
||||||
* preserve file times, and so on, during backup. */
|
|
||||||
if (openfile->current_stat == NULL && isactualfile)
|
if (openfile->current_stat == NULL && isactualfile)
|
||||||
stat_with_alloc(realname, &openfile->current_stat);
|
stat_with_alloc(realname, &openfile->current_stat);
|
||||||
|
|
||||||
/* We backup only if the backup toggle is set, the file isn't
|
/* We back up only if the backup toggle is set, and the file exists and
|
||||||
* temporary, and the file already exists. Furthermore, if we
|
* isn't temporary. Furthermore, if we aren't appending, prepending, or
|
||||||
* aren't appending, prepending, or writing a selection, we backup
|
* writing a selection, we back up only if the file has not been modified
|
||||||
* only if the file has not been modified by someone else since nano
|
* by someone else since nano opened it. */
|
||||||
* opened it. */
|
|
||||||
if (ISSET(BACKUP_FILE) && isactualfile && openfile->current_stat &&
|
if (ISSET(BACKUP_FILE) && isactualfile && 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)) {
|
||||||
|
@ -1753,7 +1751,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
|
||||||
free(backupname);
|
free(backupname);
|
||||||
}
|
}
|
||||||
|
|
||||||
skip_backup:
|
skip_backup:
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
||||||
if (f_open == NULL) {
|
if (f_open == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue