changeset 23432:a8602bad9e9a v8.2.2259

patch 8.2.2259: Test_Executable() fails when using chroot Commit: https://github.com/vim/vim/commit/a387083b2f65c2c14b19087c7d7f94ca23de1d48 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 1 14:20:44 2021 +0100 patch 8.2.2259: Test_Executable() fails when using chroot Problem: Test_Executable() fails when using chroot. Solution: Ignore the difference between "sbin" and "bin".
author Bram Moolenaar <Bram@vim.org>
date Fri, 01 Jan 2021 14:30:03 +0100
parents 0bd872d3d9fc
children f75060fff21e
files src/testdir/test_functions.vim src/version.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -1288,7 +1288,13 @@ func Test_Executable()
     " check that the relative path works in /
     lcd /
     call assert_equal(1, executable(catcmd))
-    call assert_equal('/' .. catcmd, catcmd->exepath())
+    let result = catcmd->exepath()
+    " when using chroot looking for sbin/cat can return bin/cat, that is OK
+    if catcmd =~ '\<sbin\>' && result =~ '\<bin\>'
+      call assert_equal('/' .. substitute(catcmd, '\<sbin\>', 'bin', ''), result)
+    else
+      call assert_equal('/' .. catcmd, result)
+    endif
     bwipe
   else
     throw 'Skipped: does not work on this platform'
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2259,
+/**/
     2258,
 /**/
     2257,