]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0918: tiny Vim crashes with fuzzy buffer completion v9.1.0918
author826814741_6 <44406129+826814741-6@users.noreply.github.com>
Tue, 10 Dec 2024 16:15:14 +0000 (17:15 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 10 Dec 2024 16:17:06 +0000 (17:17 +0100)
Problem:  tiny Vim crashes with fuzzy buffer completion
Solution: Adjust #ifdefs in ExpandBufnames() (826814741_6)

closes: #16200

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: 826814741_6 <44406129+826814741-6@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/buffer.c
src/testdir/Make_all.mak
src/testdir/test29.in [new file with mode: 0644]
src/testdir/test29.ok [new file with mode: 0644]
src/version.c

index 3b05f25d7f705ba2d2b13dd87cf5e52a3fbf6d02..147d20dc78f0ffdcb34ab5a7e155d8b26e3a1a50 100644 (file)
@@ -2985,9 +2985,9 @@ ExpandBufnames(
            vim_free(patc);
     }
 
-#ifdef FEAT_VIMINFO
     if (!fuzzy)
     {
+#ifdef FEAT_VIMINFO
        if (matches != NULL)
        {
            int i;
@@ -3007,13 +3007,13 @@ ExpandBufnames(
            }
            vim_free(matches);
        }
+#endif
     }
     else
     {
        if (fuzzymatches_to_strmatches(fuzmatch, file, count, FALSE) == FAIL)
            return FAIL;
     }
-#endif
 
     *num_file = count;
     return (count == 0 ? FAIL : OK);
index bdf058c1ec43a1b0fec71f9b6b30021fbf07c716..7285354838805a850c7262f20cc151075a83bc96 100644 (file)
@@ -21,7 +21,8 @@ SCRIPTS_TINY = \
        test25 \
        test26 \
        test27 \
-       test28
+       test28 \
+       test29
 
 SCRIPTS_TINY_OUT = \
        test10.out \
@@ -33,7 +34,8 @@ SCRIPTS_TINY_OUT = \
        test25.out \
        test26.out \
        test27.out \
-       test28.out
+       test28.out \
+       test29.out
 
 # Tests for Vim9 script.
 TEST_VIM9 = \
diff --git a/src/testdir/test29.in b/src/testdir/test29.in
new file mode 100644 (file)
index 0000000..047803c
--- /dev/null
@@ -0,0 +1,14 @@
+Test for buffer name completion when 'wildoptions' contains "fuzzy"
+(Confirm that Vim does not crash)
+
+STARTTEST
+:set wildoptions=fuzzy
+:new buf_a
+:b buf_a\ 4
+:q!
+:set wildoptions&
+:$w! test.out
+:qa!
+ENDTEST
+
+I'm alive!
diff --git a/src/testdir/test29.ok b/src/testdir/test29.ok
new file mode 100644 (file)
index 0000000..6a0a7c9
--- /dev/null
@@ -0,0 +1 @@
+I'm alive!
index 96b3803fa89d947d1fa8904d0fea758aacc22dcc..4fb60ac6e38b6de7425fb5f491de476e484e4186 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    918,
 /**/
     917,
 /**/