]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4851: compiler warning for uninitialized variable v8.2.4851
authorBram Moolenaar <Bram@vim.org>
Sat, 30 Apr 2022 23:42:24 +0000 (00:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 30 Apr 2022 23:42:24 +0000 (00:42 +0100)
Problem:    Compiler warning for uninitialized variable.
Solution:   Use another variable to decide to restore option values.

src/session.c
src/version.c

index d91ae198186785f264ded95ae14e0aa79f5cf6b0..795438cd835937b58da44146ee977191fec47955 100644 (file)
@@ -620,6 +620,7 @@ makeopens(
     int                only_save_windows = TRUE;
     int                nr;
     int                restore_size = TRUE;
+    int                restore_height_width = FALSE;
     win_T      *wp;
     char_u     *sname;
     win_T      *edited_win = NULL;
@@ -887,6 +888,7 @@ makeopens(
                    || put_line(fd, "set winminwidth=0") == FAIL
                    || put_line(fd, "set winwidth=1") == FAIL)
                goto fail;
+           restore_height_width = TRUE;
        }
        if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
            goto fail;
@@ -979,7 +981,7 @@ makeopens(
             goto fail;
     }
 
-    if (tab_firstwin->w_next != NULL)
+    if (restore_height_width)
     {
        // Restore 'winminheight' and 'winminwidth'.
        if (put_line(fd, "let &winminheight = s:save_winminheight") == FAIL
index 0e08c297e942d199e848ec89850d9812011636ae..7b36e622e5a68168c66a2b51ce613167dc50d11f 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4851,
 /**/
     4850,
 /**/