From: 826814741_6 <44406129+826814741-6@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:15:14 +0000 (+0100) Subject: patch 9.1.0918: tiny Vim crashes with fuzzy buffer completion X-Git-Tag: v9.1.0918^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dff3c9c1a789351a741b6a430862c8b2a0eff383;p=thirdparty%2Fvim.git 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 Signed-off-by: 826814741_6 <44406129+826814741-6@users.noreply.github.com> Signed-off-by: Christian Brabandt --- diff --git a/src/buffer.c b/src/buffer.c index 3b05f25d7f..147d20dc78 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 bdf058c1ec..7285354838 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 0000000000..047803c60f --- /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 0000000000..6a0a7c9451 --- /dev/null +++ b/src/testdir/test29.ok @@ -0,0 +1 @@ +I'm alive! diff --git a/src/version.c b/src/version.c index 96b3803fa8..4fb60ac6e3 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, /**/