mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 04:41:21 +03:00
History: no prompting on exit errors, because making the user hit Enter when
there's an error saving history state at exit is pointless and annoying. Just notify the user and move on. Patch by Mike Frysinger, tweaked and extended by Benno. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5507 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
451b299c1d
commit
277f58f8d8
@ -1,6 +1,9 @@
|
|||||||
2015-12-23 Mike Frysinger <vapier@gentoo.org>
|
2015-12-23 Mike Frysinger <vapier@gentoo.org>
|
||||||
* doc/syntax/autoconf.nanorc: Handle .m4 files too, add the "elif"
|
* doc/syntax/autoconf.nanorc: Handle .m4 files too, add the "elif"
|
||||||
keyword, handle dnl comments better, and mark trailing whitespace.
|
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>
|
2015-12-23 Christian Weisgerber <naddy@mips.inka.de>
|
||||||
* configure.ac: AC_CHECK_HEADERS_ONCE() is very special and cannot be
|
* configure.ac: AC_CHECK_HEADERS_ONCE() is very special and cannot be
|
||||||
|
14
src/files.c
14
src/files.c
@ -3077,15 +3077,15 @@ void save_history(void)
|
|||||||
FILE *hist = fopen(nanohist, "wb");
|
FILE *hist = fopen(nanohist, "wb");
|
||||||
|
|
||||||
if (hist == NULL)
|
if (hist == NULL)
|
||||||
history_error(N_("Error writing %s: %s"), nanohist,
|
fprintf(stderr, _("Error writing %s: %s\n"), nanohist,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
else {
|
else {
|
||||||
/* Make sure no one else can read from or write to the
|
/* Make sure no one else can read from or write to the
|
||||||
* history file. */
|
* history file. */
|
||||||
chmod(nanohist, S_IRUSR | S_IWUSR);
|
chmod(nanohist, S_IRUSR | S_IWUSR);
|
||||||
|
|
||||||
if (!writehist(hist, searchage) || !writehist(hist, replaceage))
|
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));
|
strerror(errno));
|
||||||
|
|
||||||
fclose(hist);
|
fclose(hist);
|
||||||
@ -3108,8 +3108,8 @@ void save_poshistory(void)
|
|||||||
FILE *hist = fopen(poshist, "wb");
|
FILE *hist = fopen(poshist, "wb");
|
||||||
|
|
||||||
if (hist == NULL)
|
if (hist == NULL)
|
||||||
history_error(N_("Error writing %s: %s"), poshist,
|
fprintf(stderr, _("Error writing %s: %s\n"), poshist,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
else {
|
else {
|
||||||
/* Make sure no one else can read from or write to the
|
/* Make sure no one else can read from or write to the
|
||||||
* history file. */
|
* history file. */
|
||||||
@ -3120,8 +3120,8 @@ void save_poshistory(void)
|
|||||||
sprintf(statusstr, "%s %ld %ld\n", posptr->filename, (long)posptr->lineno,
|
sprintf(statusstr, "%s %ld %ld\n", posptr->filename, (long)posptr->lineno,
|
||||||
(long)posptr->xno);
|
(long)posptr->xno);
|
||||||
if (fwrite(statusstr, sizeof(char), strlen(statusstr), hist) < strlen(statusstr))
|
if (fwrite(statusstr, sizeof(char), strlen(statusstr), hist) < strlen(statusstr))
|
||||||
history_error(N_("Error writing %s: %s"), poshist,
|
fprintf(stderr, _("Error writing %s: %s\n"), poshist,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
free(statusstr);
|
free(statusstr);
|
||||||
}
|
}
|
||||||
fclose(hist);
|
fclose(hist);
|
||||||
|
Loading…
Reference in New Issue
Block a user