]> git.wh0rd.org Git - nano.git/commitdiff
Also displaying the buffer when configured with only --disable-histories.
authorBenno Schulenberg <bensberg@justemail.net>
Fri, 29 Jan 2016 16:01:43 +0000 (16:01 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Fri, 29 Jan 2016 16:01:43 +0000 (16:01 +0000)
This fixes a segfault reported in Savannah bug #47011.

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

ChangeLog
src/files.c

index a12d5935112460e952e1dd8a3546f00a04dbf690..25f65a9f7510857f5a41981f956f380d6709aedf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-01-29  Benno Schulenberg  <bensberg@justemail.net>
+       * src/files.c (do_insertfile): Do display the buffer when configured
+       with only --disable-histories.  This fixes Savannah bug #47011.
+
 2016-01-26  Benno Schulenberg  <bensberg@justemail.net>
        * src/files.c (update_poshistory): Do not add directories to the
        list of file positions.  This fixes Savannah bug #46971.
index d9533d9daf8b5447e97ec0d113613304574682a2..0a4b4de8a98dbe3acb4015eff4dbde463966d60c 100644 (file)
@@ -1240,20 +1240,23 @@ void do_insertfile(
                open_buffer(answer, TRUE);
            }
 
-#if !defined(DISABLE_MULTIBUFFER) && !defined(DISABLE_HISTORIES)
+#ifndef DISABLE_MULTIBUFFER
            if (ISSET(MULTIBUFFER)) {
                /* Update the screen to account for the current buffer. */
                display_buffer();
 
-               ssize_t savedposline, savedposcol;
-               if (ISSET(POS_HISTORY) &&
+#ifndef DISABLE_HISTORIES
+               if (ISSET(POS_HISTORY)) {
+                   ssize_t priorline, priorcol;
 #ifndef NANO_TINY
-                       !execute &&
+                   if (!execute)
 #endif
-                       check_poshistory(answer, &savedposline, &savedposcol))
-                   do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE);
+                   if (check_poshistory(answer, &priorline, &priorcol))
+                       do_gotolinecolumn(priorline, priorcol, FALSE, FALSE);
+               }
+#endif /* !DISABLE_HISTORIES */
            } else
-#endif /* !DISABLE_MULTIBUFFER && !DISABLE_HISTORIES */
+#endif /* !DISABLE_MULTIBUFFER */
            {
                filestruct *top_save = openfile->fileage;