mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.4671: 'wildignorecase' is sometimes not used for glob()
Problem: 'wildignorecase' is sometimes not used for glob(). Solution: Also use 'wildignorecase' when there are no wildcards. (closes #10066, closes #8350)
This commit is contained in:
@@ -3945,13 +3945,13 @@ gen_expand_wildcards(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there are wildcards: Expand file names and add each match to
|
* If there are wildcards or case-insensitive expansion is
|
||||||
* the list. If there is no match, and EW_NOTFOUND is given, add
|
* required: Expand file names and add each match to the list. If
|
||||||
* the pattern.
|
* 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
|
* Otherwise: Add the file name if it exists or when EW_NOTFOUND is
|
||||||
* when EW_NOTFOUND is given.
|
* given.
|
||||||
*/
|
*/
|
||||||
if (mch_has_exp_wildcard(p))
|
if (mch_has_exp_wildcard(p) || (flags & EW_ICASE))
|
||||||
{
|
{
|
||||||
#if defined(FEAT_SEARCHPATH)
|
#if defined(FEAT_SEARCHPATH)
|
||||||
if ((flags & EW_PATH)
|
if ((flags & EW_PATH)
|
||||||
|
@@ -2821,6 +2821,8 @@ func Test_glob()
|
|||||||
" Sort output of glob() otherwise we end up with different
|
" Sort output of glob() otherwise we end up with different
|
||||||
" ordering depending on whether file system is case-sensitive.
|
" ordering depending on whether file system is case-sensitive.
|
||||||
call assert_equal(['XGLOB2', 'Xglob1'], sort(glob('Xglob[12]', 0, 1)))
|
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&
|
set wildignorecase&
|
||||||
|
|
||||||
call delete('Xglob1')
|
call delete('Xglob1')
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4671,
|
||||||
/**/
|
/**/
|
||||||
4670,
|
4670,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user