diff --git a/ChangeLog b/ChangeLog index f89845dcfba6442fc973d38dc6ee8a27f02db529..f96380bfb8389c46d5a44c9aad9e5f884b7c5781 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2015-12-23 Mike Frysinger <vapier@gentoo.org> * doc/syntax/autoconf.nanorc: Handle .m4 files too, add the "elif" keyword, handle dnl comments better, and mark trailing whitespace. + * src/files.c (save_history, save_poshistory): Don't make the user + hit Enter when there's an error saving history state at exit; it is + pointless and annoying. Just notify the user and move on. 2015-12-23 Christian Weisgerber <naddy@mips.inka.de> * configure.ac: AC_CHECK_HEADERS_ONCE() is very special and cannot be diff --git a/src/files.c b/src/files.c index db41c6009ee02057c055edb2b646b30e6cbc13a7..d5a4ca4341295a4c01a1eccb64e7f993ec6e624b 100644 --- a/src/files.c +++ b/src/files.c @@ -3077,15 +3077,15 @@ void save_history(void) FILE *hist = fopen(nanohist, "wb"); if (hist == NULL) - history_error(N_("Error writing %s: %s"), nanohist, - strerror(errno)); + fprintf(stderr, _("Error writing %s: %s\n"), nanohist, + strerror(errno)); else { /* Make sure no one else can read from or write to the * history file. */ chmod(nanohist, S_IRUSR | S_IWUSR); if (!writehist(hist, searchage) || !writehist(hist, replaceage)) - history_error(N_("Error writing %s: %s"), nanohist, + fprintf(stderr, _("Error writing %s: %s\n"), nanohist, strerror(errno)); fclose(hist); @@ -3108,8 +3108,8 @@ void save_poshistory(void) FILE *hist = fopen(poshist, "wb"); if (hist == NULL) - history_error(N_("Error writing %s: %s"), poshist, - strerror(errno)); + fprintf(stderr, _("Error writing %s: %s\n"), poshist, + strerror(errno)); else { /* Make sure no one else can read from or write to the * history file. */ @@ -3120,8 +3120,8 @@ void save_poshistory(void) sprintf(statusstr, "%s %ld %ld\n", posptr->filename, (long)posptr->lineno, (long)posptr->xno); if (fwrite(statusstr, sizeof(char), strlen(statusstr), hist) < strlen(statusstr)) - history_error(N_("Error writing %s: %s"), poshist, - strerror(errno)); + fprintf(stderr, _("Error writing %s: %s\n"), poshist, + strerror(errno)); free(statusstr); } fclose(hist);