patch 9.2.0734: function pointer passed to STRNCMP() instead of a length
Commit:
https://github.com/vim/vim/commit/f82132813cc1e689c3eb5997963f9678db2a39dd
Author: Shane Harper <
sh...@shaneharper.net>
Date: Fri Jun 26 20:45:25 2026 +0000
patch 9.2.0734: function pointer passed to STRNCMP() instead of a length
Problem: In the popup 'close' option-value completion check, a function
pointer (the address of close()) was passed as STRNCMP()'s
third argument instead of the string length.
Solution: Pass the length (close_len). (Shane Harper)
The user-visible effect was negligible: ":set completepopup=close:o<Tab>"
offered no completions instead of "on" and "off".
closes: #20642
Co-Authored-By: Claude Opus 4.8 <
nor...@anthropic.com>
Signed-off-by: Shane Harper <
sh...@shaneharper.net>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/optionstr.c b/src/optionstr.c
index b60e59586..b187dc319 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -3516,7 +3516,7 @@ expand_set_popupoption(optexpand_T *args, int *numMatches, char_u ***matches,
int is_border = xp->xp_pattern - args->oe_set_arg >= border_len &&
STRNCMP(xp->xp_pattern - border_len, "border:", border_len) == 0;
int is_close = xp->xp_pattern - args->oe_set_arg >= close_len &&
- STRNCMP(xp->xp_pattern - close_len, "close:", close) == 0;
+ STRNCMP(xp->xp_pattern - close_len, "close:", close_len) == 0;
int is_resize = xp->xp_pattern - args->oe_set_arg >= resize_len &&
STRNCMP(xp->xp_pattern - resize_len, "resize:", resize_len) == 0;
int is_shadow = xp->xp_pattern - args->oe_set_arg >= shadow_len &&
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index 4b7eea1b2..7580ace6d 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -663,6 +663,9 @@ func Test_set_completion_string_values()
call feedkeys(":set completepopup=height:10,align:\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"set completepopup=height:10,align:item', @:)
call assert_equal([], getcompletion('set completepopup=bogusname:', 'cmdline'))
+ call assert_equal(['on', 'off'], getcompletion('set completepopup=close:', 'cmdline'))
+ call assert_equal(['on', 'off'], getcompletion('set completepopup=close:o', 'cmdline'))
+ call assert_equal(['off'], getcompletion('set previewpopup=close:of', 'cmdline'))
" opacity: numeric, 0..100 only
call assert_true(index(getcompletion('set completepopup=', 'cmdline'),
diff --git a/src/version.c b/src/version.c
index 742ff9a21..85bb6d17e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 734,
/**/
733,
/**/