- files.c:
open_file()
- Fix FD leak with file load error (David Benbennick).
+ save_history()
+ - Fix nrealloc return value being ignored (David Benbennick).
- nano.c:
do_preserve_msg():
- Unsplit error message into a single fprintf call (Jordi).
chmod(nanohist, S_IRUSR | S_IWUSR);
/* write oldest first */
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");
if (fputs(h->data, hist) == EOF) {
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
goto come_from;
}
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");
if (fputs(h->data, hist) == EOF) {
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));