patch 9.1.0918: tiny Vim crashes with fuzzy buffer completion
Commit:
https://github.com/vim/vim/commit/dff3c9c1a789351a741b6a430862c8b2a0eff383
Author: 826814741_6 <[email protected]>
Date: Tue Dec 10 17:15:14 2024 +0100
patch 9.1.0918: tiny Vim crashes with fuzzy buffer completion
Problem: tiny Vim crashes with fuzzy buffer completion
Solution: Adjust #ifdefs in ExpandBufnames() (826814741_6)
closes: #16200
Signed-off-by: h-east <[email protected]>
Signed-off-by: 826814741_6 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/buffer.c b/src/buffer.c
index 3b05f25d7..147d20dc7 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -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);
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index bdf058c1e..728535483 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -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
index 000000000..047803c60
--- /dev/null
+++ b/src/testdir/test29.in
@@ -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
+: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
index 000000000..6a0a7c945
--- /dev/null
+++ b/src/testdir/test29.ok
@@ -0,0 +1 @@
+I'm alive!
diff --git a/src/version.c b/src/version.c
index 96b3803fa..4fb60ac6e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 918,
/**/
917,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1tL4lJ-004u7k-En%40256bit.org.