patch 9.1.1528: completion: crash with getcompletion()

Commit: 
https://github.com/vim/vim/commit/f2ec8d4afc0623a477d198c42994544190b4e427
Author: Christian Brabandt <c...@256bit.org>
Date:   Tue Jul 8 22:04:10 2025 +0200

    patch 9.1.1528: completion: crash with getcompletion()
    
    Problem:  completion: crash with getcompletion()
              (zeertzjq)
    Solution: Don't set may_expand_pattern in f_getcompletion(),
              unset may_expand_pattern() once it is not longer needed
              (Girish Palya).
    
    fixes: #17680
    closes: #17686
    
    Signed-off-by: Girish Palya <giris...@gmail.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 75efe1c62..bdfa67945 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -233,7 +233,6 @@ nextwild(
 
     if (xp->xp_numfiles == -1)
     {
-       may_expand_pattern = options & WILD_MAY_EXPAND_PATTERN;
        pre_incsearch_pos = xp->xp_pre_incsearch_pos;
 #ifdef FEAT_EVAL
        if (ccline->input_fn && ccline->xp_context == EXPAND_COMMANDS)
@@ -244,7 +243,9 @@ nextwild(
        else
 #endif
        {
+           may_expand_pattern = options & WILD_MAY_EXPAND_PATTERN;
            set_expand_context(xp);
+           may_expand_pattern = FALSE;
        }
        cmd_showtail = expand_showtail(xp);
     }
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 47adb2b08..46ace6616 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -4478,7 +4478,7 @@ func Test_search_complete()
   call feedkeys("gg/Fo\<tab>\<f9>", 'tx')
   call assert_equal(['Foobar', 'FooBARR'], g:compl_info.matches)
   call feedkeys("gg/FO\<tab>\<f9>", 'tx')
-  call assert_equal({},  g:compl_info)
+  call assert_equal({}, g:compl_info)
   call feedkeys("gg/\cFo\<tab>\<f9>", 'tx')
   call assert_equal(['

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1uZEiU-00BIkW-W1%40256bit.org.

Raspunde prin e-mail lui