From: Shane Harper Date: Fri, 26 Jun 2026 20:45:25 +0000 (+0000) Subject: patch 9.2.0734: function pointer passed to STRNCMP() instead of a length X-Git-Tag: v9.2.0734^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f82132813cc1e689c3eb5997963f9678db2a39dd;p=thirdparty%2Fvim.git 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" offered no completions instead of "on" and "off". closes: #20642 Co-Authored-By: Claude Opus 4.8 Signed-off-by: Shane Harper Signed-off-by: Christian Brabandt --- diff --git a/src/optionstr.c b/src/optionstr.c index b60e595868..b187dc3192 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 4b7eea1b2f..7580ace6db 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:\\\"\", '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 742ff9a216..85bb6d17e1 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, /**/