commit 8b86af3fef1b07c0ae7dd77c56d5b01b5de036cc
parent 21a59780271677e38a87a58dc566deee8a7c8c39
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 15 Aug 2017 19:13:22 +0200
tweaks: adjust the indentation after the previous change
Diffstat:
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -2863,9 +2863,9 @@ void save_history(void)
char *searchhist;
FILE *hist;
- /* Don't save unchanged or empty histories. */
+ /* If the histories are unchanged or empty, don't bother saving them. */
if (!history_has_changed() || (searchbot->lineno == 1 &&
- replacebot->lineno == 1))
+ replacebot->lineno == 1))
return;
searchhist = histfilename();
@@ -2873,23 +2873,23 @@ void save_history(void)
if (searchhist == NULL)
return;
- hist = fopen(searchhist, "wb");
+ hist = fopen(searchhist, "wb");
- if (hist == NULL)
- fprintf(stderr, _("Error writing %s: %s\n"), searchhist,
+ if (hist == NULL)
+ fprintf(stderr, _("Error writing %s: %s\n"), searchhist,
strerror(errno));
- else {
+ else {
/* Don't allow others to read or write the history file. */
- chmod(searchhist, S_IRUSR | S_IWUSR);
+ chmod(searchhist, S_IRUSR | S_IWUSR);
- if (!writehist(hist, searchage) || !writehist(hist, replaceage))
- fprintf(stderr, _("Error writing %s: %s\n"), searchhist,
+ if (!writehist(hist, searchage) || !writehist(hist, replaceage))
+ fprintf(stderr, _("Error writing %s: %s\n"), searchhist,
strerror(errno));
- fclose(hist);
- }
+ fclose(hist);
+ }
- free(searchhist);
+ free(searchhist);
}
/* Save the recorded last file positions to ~/.nano/filepos_history. */