]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0152: Coverity complains about ignoring return value v9.1.0152
authorChristian Brabandt <cb@256bit.org>
Wed, 6 Mar 2024 18:31:39 +0000 (19:31 +0100)
committerChristian Brabandt <cb@256bit.org>
Wed, 6 Mar 2024 19:43:05 +0000 (20:43 +0100)
Problem:  Coverity complains about ignoring return value of win_split()
          (after v9.1.150)
Solution: Check if win_split() failed, add winfixbuf.res to Makefile

src/ex_cmds2.c
src/testdir/Make_all.mak
src/testdir/test_winfixbuf.vim
src/version.c

index 7233893b175a93b9f3a692877b312b827abcbf94..4b575b4d8c1235e921f15425f841c7bce6e917f2 100644 (file)
@@ -469,15 +469,14 @@ ex_listdo(exarg_T *eap)
        }
 
        if (win_valid(prevwin) && !prevwin->w_p_wfb)
-       {
            // 'winfixbuf' is set; attempt to change to a window without it.
            win_goto(prevwin);
-       }
        if (curwin->w_p_wfb)
        {
            // Split the window, which will be 'nowinfixbuf', and set curwin to
            // that
-           win_split(0, 0);
+           if (win_split(0, 0) == FAIL)
+               return; // error message already given
 
            if (curwin->w_p_wfb)
            {
index d365dfc84f4086b8997fdef6feefd4ef090ee019..c4403e67ae6ff33a516553af887078987b04b80e 100644 (file)
@@ -558,6 +558,7 @@ NEW_TESTS_RES = \
        test_window_cmd.res \
        test_window_id.res \
        test_windows_home.res \
+       test_winfixbuf.res \
        test_wordcount.res \
        test_writefile.res \
        test_xxd.res \
index 8a1862c3e521f8ebb9e41aae5e4625ddae929c10..edbe2c8f540a869512018aa5d1875104c172f871 100644 (file)
@@ -3248,4 +3248,15 @@ func Test_quickfix_changed_split_failed()
   augroup! QfChanged
 endfunc
 
+func Test_bufdo_splitwin_fails()
+  call s:reset_all_buffers()
+  let other = s:make_buffer_pairs()
+  " Make sure there is not enough room to
+  " split the winfixedbuf window
+  let &winheight=&lines
+  let &winminheight=&lines-2
+  call assert_fails(':bufdo echo 1', 'E36:')
+  set winminheight&vim winheight&vim
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index ae5d17a1a8f26d5edeafa661511f3dcc31b4c54f..cf0af43043cbdb4e11fc4b2dc1673fb7caf778a6 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    152,
 /**/
     151,
 /**/