Patch 8.2.0985

6 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 15, 2020, 3:45:07 PM6/15/20
to vim...@googlegroups.com

Patch 8.2.0985
Problem: Simplify() does not remove slashes from "///path".
Solution: Reduce > 2 slashes to one. (closes #6263)
Files: src/findfile.c, src/testdir/test_functions.vim


*** ../vim-8.2.0984/src/findfile.c 2020-06-12 22:59:07.266097201 +0200
--- src/findfile.c 2020-06-15 21:41:04.872019011 +0200
***************
*** 2641,2646 ****
--- 2641,2654 ----
while (vim_ispathsep(*p));
}
start = p; // remember start after "c:/" or "/" or "///"
+ #ifdef UNIX
+ // Posix says that "//path" is unchanged but "///path" is "/path".
+ if (start > filename + 2)
+ {
+ STRMOVE(filename + 1, p);
+ start = p = filename + 1;
+ }
+ #endif

do
{
*** ../vim-8.2.0984/src/testdir/test_functions.vim 2020-06-10 16:54:09.569078300 +0200
--- src/testdir/test_functions.vim 2020-06-15 21:40:36.148144972 +0200
***************
*** 463,468 ****
--- 463,472 ----
call assert_equal('/', simplify('/.'))
call assert_equal('/', simplify('/..'))
call assert_equal('/...', simplify('/...'))
+ call assert_equal('//path', simplify('//path'))
+ call assert_equal('/path', simplify('///path'))
+ call assert_equal('/path', simplify('////path'))
+
call assert_equal('./dir/file', './dir/file'->simplify())
call assert_equal('./dir/file', simplify('.///dir//file'))
call assert_equal('./dir/file', simplify('./dir/./file'))
***************
*** 1355,1360 ****
--- 1359,1365 ----

" Test for the inputdialog() function
func Test_inputdialog()
+ set timeout timeoutlen=10
if has('gui_running')
call assert_fails('let v=inputdialog([], "xx")', 'E730:')
call assert_fails('let v=inputdialog("Q", [])', 'E730:')
***************
*** 1364,1369 ****
--- 1369,1375 ----
call feedkeys(":let v=inputdialog('Q:', 'xx', 'yy')\<CR>\<Esc>", 'xt')
call assert_equal('yy', v)
endif
+ set timeout& timeoutlen&
endfunc

" Test for inputlist()
***************
*** 1916,1922 ****
\ ->map({-> v:val.name})
call sort(files)->assert_equal(['bar.txt', 'dir', 'foo.txt'])

! " report brocken link correctly
if has("unix")
call writefile([], 'Xdir/abc.txt')
call system("ln -s Xdir/abc.txt Xdir/link")
--- 1922,1928 ----
\ ->map({-> v:val.name})
call sort(files)->assert_equal(['bar.txt', 'dir', 'foo.txt'])

! " report broken link correctly
if has("unix")
call writefile([], 'Xdir/abc.txt')
call system("ln -s Xdir/abc.txt Xdir/link")
*** ../vim-8.2.0984/src/version.c 2020-06-15 21:19:04.017590497 +0200
--- src/version.c 2020-06-15 21:37:05.553088144 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 985,
/**/

--
ARTHUR: Shut up! Will you shut up!
DENNIS: Ah, now we see the violence inherent in the system.
ARTHUR: Shut up!
DENNIS: Oh! Come and see the violence inherent in the system!
HELP! HELP! I'm being repressed!
The Quest for the Holy Grail (Monty Python)

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