To: vim_dev@googlegroups.com Subject: Patch 8.2.2430 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2430 Problem: :vimgrep expands wildcards twice. Solution: Do not expand wildcards a second time. Files: src/quickfix.c, src/arglist.c, src/testdir/test_quickfix.vim *** ../vim-8.2.2429/src/quickfix.c 2021-01-03 19:51:01.396063220 +0100 --- src/quickfix.c 2021-01-30 17:56:34.138479993 +0100 *************** *** 6053,6059 **** return FAIL; } ! // parse the list of arguments if (get_arglist_exp(p, &args->fcount, &args->fnames, TRUE) == FAIL) return FAIL; if (args->fcount == 0) --- 6053,6059 ---- return FAIL; } ! // Parse the list of arguments, wildcards have already been expanded. if (get_arglist_exp(p, &args->fcount, &args->fnames, TRUE) == FAIL) return FAIL; if (args->fcount == 0) *** ../vim-8.2.2429/src/arglist.c 2021-01-28 14:24:51.181688004 +0100 --- src/arglist.c 2021-01-30 18:06:28.808243270 +0100 *************** *** 315,324 **** return FAIL; if (wig == TRUE) i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, ! fcountp, fnamesp, EW_FILE|EW_NOTFOUND); else i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, ! fcountp, fnamesp, EW_FILE|EW_NOTFOUND); ga_clear(&ga); return i; --- 315,324 ---- return FAIL; if (wig == TRUE) i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, ! fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD); else i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, ! fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD); ga_clear(&ga); return i; *** ../vim-8.2.2429/src/testdir/test_quickfix.vim 2021-01-28 13:47:55.056905117 +0100 --- src/testdir/test_quickfix.vim 2021-01-30 18:06:52.468191149 +0100 *************** *** 2865,2870 **** --- 2865,2877 ---- call XvimgrepTests('l') endfunc + func Test_vimgrep_wildcards_expanded_once() + new X[id-01] file.txt + call setline(1, 'some text to search for') + vimgrep text % + bwipe! + endfunc + " Test for incsearch highlighting of the :vimgrep pattern " This test used to cause "E315: ml_get: invalid lnum" errors. func Test_vimgrep_incsearch() *** ../vim-8.2.2429/src/version.c 2021-01-30 17:16:24.648042670 +0100 --- src/version.c 2021-01-30 18:07:13.200157936 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2430, /**/ -- This sentence is not sure that it exists, but if it does, it will certainly consider the possibility that other sentences exist. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///