Skip to content

Commit 15ecbd6

Browse files
committed
patch 8.0.0545: edit test may fail on some systems
Problem: Edit test may fail on some systems. Solution: If creating a directory with a very long path fails, bail out.
1 parent 866c688 commit 15ecbd6

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/testdir/test_edit.vim

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,22 +1324,31 @@ func! Test_edit_rightleft()
13241324
endfunc
13251325

13261326
func Test_edit_complete_very_long_name()
1327-
if !has('unix') || has('mac')
1327+
if !has('unix')
13281328
" Long directory names only work on Unix.
13291329
return
13301330
endif
1331+
1332+
let dirname = getcwd() . "/Xdir"
1333+
let longdirname = dirname . repeat('/' . repeat('d', 255), 4)
1334+
try
1335+
call mkdir(longdirname, 'p')
1336+
catch /E739:/
1337+
" Long directory name probably not supported.
1338+
call delete(dirname, 'rf')
1339+
return
1340+
endtry
1341+
13311342
" Try to get the Vim window position before setting 'columns'.
13321343
let winposx = getwinposx()
13331344
let winposy = getwinposy()
13341345
let save_columns = &columns
1346+
" Need at least about 1100 columns to reproduce the problem.
13351347
set columns=2000
13361348
call assert_equal(2000, &columns)
13371349
set noswapfile
13381350

1339-
let dirname = getcwd() . "/Xdir"
1340-
let longdirname = dirname . repeat('/' . repeat('d', 255), 4)
13411351
let longfilename = longdirname . '/' . repeat('a', 255)
1342-
call mkdir(longdirname, 'p')
13431352
call writefile(['Totum', 'Table'], longfilename)
13441353
new
13451354
exe "next Xfile " . longfilename

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
545,
767769
/**/
768770
544,
769771
/**/

0 commit comments

Comments
 (0)