To: vim_dev@googlegroups.com Subject: Patch 8.2.1804 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1804 Problem: resolve('/') returns an empty string. Solution: Don't remove single slash. (closes #7074) Files: src/filepath.c, src/testdir/test_functions.vim *** ../vim-8.2.1803/src/filepath.c 2020-09-25 23:48:58.003938752 +0200 --- src/filepath.c 2020-10-05 20:36:51.261287143 +0200 *************** *** 1889,1895 **** is_relative_to_current = TRUE; len = STRLEN(p); ! if (len > 0 && after_pathsep(p, p + len)) { has_trailing_pathsep = TRUE; p[len - 1] = NUL; // the trailing slash breaks readlink() --- 1889,1895 ---- is_relative_to_current = TRUE; len = STRLEN(p); ! if (len > 1 && after_pathsep(p, p + len)) { has_trailing_pathsep = TRUE; p[len - 1] = NUL; // the trailing slash breaks readlink() *** ../vim-8.2.1803/src/testdir/test_functions.vim 2020-09-25 22:42:43.852669232 +0200 --- src/testdir/test_functions.vim 2020-10-05 20:36:05.533395161 +0200 *************** *** 339,344 **** --- 339,346 ---- call assert_equal('Xlink2', resolve('Xlink1')) call assert_equal('./Xlink2', resolve('./Xlink1')) call delete('Xlink1') + + call assert_equal('/', resolve('/')) endfunc func s:normalize_fname(fname) *** ../vim-8.2.1803/src/version.c 2020-10-05 20:07:14.413414315 +0200 --- src/version.c 2020-10-05 20:35:23.609493584 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1804, /**/ -- Those who live by the sword get shot by those who don't. /// Bram Moolenaar -- Bram@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 ///