]> git.wh0rd.org Git - nano.git/commitdiff
port over DB's (better) equivalent of the last fix, and tweak a few
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Thu, 26 May 2005 06:09:07 +0000 (06:09 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Thu, 26 May 2005 06:09:07 +0000 (06:09 +0000)
comments

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2550 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/global.c

index d79e0a07f1f573163ee608249d2c1838ed69703a..2e4fe494eb1ad2f7af9dfbcef01aac71b750c2ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,7 +72,7 @@ CVS code -
          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:
index 5c8cd08c0bbf16e61d074103b0fded7527a1ea33..0ce8b6628d59d6a61b8672cff5b9df619f7dfb62 100644 (file)
@@ -1208,6 +1208,7 @@ void thanks_for_all_the_fish(void)
     free_shortcutage(&gotodir_list);
 #endif
 #ifndef NANO_SMALL
+    /* Free the memory associated with each toggle. */
     while (toggles != NULL) {
        toggle *t = toggles;
 
@@ -1217,8 +1218,13 @@ void thanks_for_all_the_fish(void)
 #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);
@@ -1252,7 +1258,7 @@ void thanks_for_all_the_fish(void)
     }
 #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)