- files.c:save_history() - Fix nrealloc return value being ignored (David Benbennick)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1395 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
fa1588608e
commit
77e726d518
|
@ -15,6 +15,8 @@ CVS Code -
|
||||||
- files.c:
|
- files.c:
|
||||||
open_file()
|
open_file()
|
||||||
- Fix FD leak with file load error (David Benbennick).
|
- Fix FD leak with file load error (David Benbennick).
|
||||||
|
save_history()
|
||||||
|
- Fix nrealloc return value being ignored (David Benbennick).
|
||||||
- nano.c:
|
- nano.c:
|
||||||
do_preserve_msg():
|
do_preserve_msg():
|
||||||
- Unsplit error message into a single fprintf call (Jordi).
|
- Unsplit error message into a single fprintf call (Jordi).
|
||||||
|
|
4
files.c
4
files.c
|
@ -2925,7 +2925,7 @@ void save_history(void)
|
||||||
chmod(nanohist, S_IRUSR | S_IWUSR);
|
chmod(nanohist, S_IRUSR | S_IWUSR);
|
||||||
/* write oldest first */
|
/* write oldest first */
|
||||||
for (h = search_history.tail ; h->prev ; h = h->prev) {
|
for (h = search_history.tail ; h->prev ; h = h->prev) {
|
||||||
nrealloc(h->data, strlen(h->data) + 1);
|
h->data = nrealloc(h->data, strlen(h->data) + 1);
|
||||||
strcat(h->data, "\n");
|
strcat(h->data, "\n");
|
||||||
if (fputs(h->data, hist) == EOF) {
|
if (fputs(h->data, hist) == EOF) {
|
||||||
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
|
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
|
||||||
|
@ -2937,7 +2937,7 @@ void save_history(void)
|
||||||
goto come_from;
|
goto come_from;
|
||||||
}
|
}
|
||||||
for (h = replace_history.tail ; h->prev ; h = h->prev) {
|
for (h = replace_history.tail ; h->prev ; h = h->prev) {
|
||||||
nrealloc(h->data, strlen(h->data) + 1);
|
h->data = nrealloc(h->data, strlen(h->data) + 1);
|
||||||
strcat(h->data, "\n");
|
strcat(h->data, "\n");
|
||||||
if (fputs(h->data, hist) == EOF) {
|
if (fputs(h->data, hist) == EOF) {
|
||||||
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
|
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
|
||||||
|
|
Loading…
Reference in New Issue