nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit b9e3e4edb8d0bbba86e4bcbb51c091a227a0faec
parent 2d204bcbfd92898d0b60522c19bd25d0917b3de8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 29 Jun 2020 11:56:36 +0200

history: don't send error messages to the screen; store them in the queue

Diffstat:
Msrc/history.c | 11++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/history.c b/src/history.c @@ -358,8 +358,7 @@ void save_history(void) hisfile = fopen(histname, "wb"); if (hisfile == NULL) - fprintf(stderr, _("Error writing %s: %s\n"), histname, - strerror(errno)); + jot_error(N_("Error writing %s: %s\n"), histname, strerror(errno)); else { /* Don't allow others to read or write the history file. */ chmod(histname, S_IRUSR | S_IWUSR); @@ -367,8 +366,7 @@ void save_history(void) if (!write_list(searchtop, hisfile) || !write_list(replacetop, hisfile) || !write_list(executetop, hisfile)) - fprintf(stderr, _("Error writing %s: %s\n"), histname, - strerror(errno)); + jot_error(N_("Error writing %s: %s\n"), histname, strerror(errno)); fclose(hisfile); } @@ -449,7 +447,7 @@ void save_poshistory(void) FILE *hisfile = fopen(poshistname, "wb"); if (hisfile == NULL) - fprintf(stderr, _("Error writing %s: %s\n"), poshistname, strerror(errno)); + jot_error(N_("Error writing %s: %s\n"), poshistname, strerror(errno)); else { /* Don't allow others to read or write the history file. */ chmod(poshistname, S_IRUSR | S_IWUSR); @@ -471,8 +469,7 @@ void save_poshistory(void) path_and_place[length - 1] = '\n'; if (fwrite(path_and_place, sizeof(char), length, hisfile) < length) - fprintf(stderr, _("Error writing %s: %s\n"), - poshistname, strerror(errno)); + jot_error(N_("Error writing %s: %s\n"), poshistname, strerror(errno)); free(path_and_place); } fclose(hisfile);