Patch 9.0.0126
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)
Files: src/findfile.c, src/testdir/test_gf.vim
*** ../vim-9.0.0125/src/findfile.c 2022-01-31 14:34:19.000000000 +0000
--- src/findfile.c 2022-08-01 11:33:56.452012972 +0100
***************
*** 75,81 ****
// of wc_part
char_u **ffs_filearray;
int ffs_filearray_size;
! char_u ffs_filearray_cur; // needed for partly handled dirs
// to store status of partly handled directories
// 0: we work on this directory for the first time
--- 75,81 ----
// of wc_part
char_u **ffs_filearray;
int ffs_filearray_size;
! int ffs_filearray_cur; // needed for partly handled dirs
// to store status of partly handled directories
// 0: we work on this directory for the first time
*** ../vim-9.0.0125/src/testdir/test_gf.vim 2022-05-14 21:25:03.000000000 +0100
--- src/testdir/test_gf.vim 2022-08-01 11:36:10.691719263 +0100
***************
*** 138,144 ****
call assert_equal('Xtest_gf_visual', bufname('%'))
call assert_equal(3, getcurpos()[1])
! " do not include the NUL at the end
call writefile(['x'], 'X')
let save_enc = &enc
for enc in ['latin1', 'utf-8']
--- 138,144 ----
call assert_equal('Xtest_gf_visual', bufname('%'))
call assert_equal(3, getcurpos()[1])
! " do not include the NUL at the end
call writefile(['x'], 'X')
let save_enc = &enc
for enc in ['latin1', 'utf-8']
***************
*** 250,253 ****
--- 250,276 ----
bw!
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-9.0.0125/src/version.c 2022-08-01 11:17:36.761985329 +0100
--- src/version.c 2022-08-01 11:32:45.368195552 +0100
***************
*** 737,738 ****
--- 737,740 ----
{ /* Add new patch number below this line */
+ /**/
+ 126,
/**/
--
'Psychologist' -- Someone who looks at everyone else when
an attractive woman enters the room.
/// 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 ///