Patch 8.2.4671

6 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 3, 2022, 6:59:49 AM4/3/22
to vim...@googlegroups.com

Patch 8.2.4671
Problem: 'wildignorecase' is sometimes not used for glob().
Solution: Also use 'wildignorecase' when there are no wildcards.
(closes #10066, closes #8350)
Files: src/filepath.c, src/testdir/test_functions.vim


*** ../vim-8.2.4670/src/filepath.c 2022-03-31 11:37:54.255367937 +0100
--- src/filepath.c 2022-04-03 11:57:25.590406403 +0100
***************
*** 3945,3957 ****
}

/*
! * If there are wildcards: Expand file names and add each match to
! * the list. If there is no match, and EW_NOTFOUND is given, add
! * the pattern.
! * If there are no wildcards: Add the file name if it exists or
! * when EW_NOTFOUND is given.
*/
! if (mch_has_exp_wildcard(p))
{
#if defined(FEAT_SEARCHPATH)
if ((flags & EW_PATH)
--- 3945,3957 ----
}

/*
! * If there are wildcards or case-insensitive expansion is
! * required: Expand file names and add each match to the list. If
! * there is no match, and EW_NOTFOUND is given, add the pattern.
! * Otherwise: Add the file name if it exists or when EW_NOTFOUND is
! * given.
*/
! if (mch_has_exp_wildcard(p) || (flags & EW_ICASE))
{
#if defined(FEAT_SEARCHPATH)
if ((flags & EW_PATH)
*** ../vim-8.2.4670/src/testdir/test_functions.vim 2022-03-15 09:46:50.757054758 +0000
--- src/testdir/test_functions.vim 2022-04-03 11:51:51.319590450 +0100
***************
*** 2821,2826 ****
--- 2821,2828 ----
" Sort output of glob() otherwise we end up with different
" ordering depending on whether file system is case-sensitive.
call assert_equal(['XGLOB2', 'Xglob1'], sort(glob('Xglob[12]', 0, 1)))
+ " wildignorecase shall be applied even when the pattern contains no wildcards.
+ call assert_equal('XGLOB2', glob('xglob2'))
set wildignorecase&

call delete('Xglob1')
*** ../vim-8.2.4670/src/version.c 2022-04-03 11:22:33.528172299 +0100
--- src/version.c 2022-04-03 11:53:36.347347715 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4671,
/**/

--
Dreams are free, but there's a small charge for alterations.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages