forked from aniani/vim
patch 9.0.0126: expanding file names fails in dir with more than 255 entries
Problem: Expanding file names fails in directory with more than 255 entries. Solution: Use an int instead of char_u to count. (John Drouhard, closes #10818)
This commit is contained in:
committed by
Bram Moolenaar
parent
84b247fab7
commit
95fca12b0e
@@ -75,7 +75,7 @@ typedef struct ff_stack
|
|||||||
// of wc_part
|
// of wc_part
|
||||||
char_u **ffs_filearray;
|
char_u **ffs_filearray;
|
||||||
int ffs_filearray_size;
|
int ffs_filearray_size;
|
||||||
char_u ffs_filearray_cur; // needed for partly handled dirs
|
int ffs_filearray_cur; // needed for partly handled dirs
|
||||||
|
|
||||||
// to store status of partly handled directories
|
// to store status of partly handled directories
|
||||||
// 0: we work on this directory for the first time
|
// 0: we work on this directory for the first time
|
||||||
|
@@ -250,4 +250,27 @@ func Test_includeexpr_scriptlocal_func()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Check that expanding directories can handle more than 255 entries.
|
||||||
|
func Test_gf_subdirs_wildcard()
|
||||||
|
let cwd = getcwd()
|
||||||
|
let dir = 'Xtestgf_dir'
|
||||||
|
call mkdir(dir)
|
||||||
|
call chdir(dir)
|
||||||
|
for i in range(300)
|
||||||
|
call mkdir(i)
|
||||||
|
call writefile([], i .. '/' .. i, 'S')
|
||||||
|
endfor
|
||||||
|
set path=./**
|
||||||
|
|
||||||
|
new | only
|
||||||
|
call setline(1, '99')
|
||||||
|
w! Xtest1
|
||||||
|
normal gf
|
||||||
|
call assert_equal('99', fnamemodify(bufname(''), ":t"))
|
||||||
|
|
||||||
|
call chdir(cwd)
|
||||||
|
call delete(dir, 'rf')
|
||||||
|
set path&
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -735,6 +735,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 */
|
||||||
|
/**/
|
||||||
|
126,
|
||||||
/**/
|
/**/
|
||||||
125,
|
125,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user