only called here anyway. (David Benbennick)
- Fix the code to free all open file buffers to work properly
with the previous overhaul of the multibuffer code instead of
- going into an infinite loop. (DLR)
+ going into an infinite loop. (David Benbennick)
- Add additional checks for variables' not being NULL before we
try to free them, to avoid assertion failures. (DLR)
- nano.c:
free_shortcutage(&gotodir_list);
#endif
#ifndef NANO_SMALL
+ /* Free the memory associated with each toggle. */
while (toggles != NULL) {
toggle *t = toggles;
#endif
#ifdef ENABLE_MULTIBUFFER
/* Free the memory associated with each open file buffer. */
- if (open_files != NULL)
+ if (open_files != NULL) {
+ /* Make sure open_files->fileage is up to date, in case we've
+ * cut the top line of the file. */
+ open_files->fileage = fileage;
+
free_openfilestruct(open_files);
+ }
#else
if (fileage != NULL)
free_filestruct(fileage);
}
#endif /* ENABLE_COLOR */
#ifndef NANO_SMALL
- /* Free the history lists. */
+ /* Free the search and replace history lists. */
if (searchage != NULL)
free_filestruct(searchage);
if (replaceage != NULL)