]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.2259: Test_Executable() fails when using chroot v8.2.2259
authorBram Moolenaar <Bram@vim.org>
Fri, 1 Jan 2021 13:20:44 +0000 (14:20 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 1 Jan 2021 13:20:44 +0000 (14:20 +0100)
Problem:    Test_Executable() fails when using chroot.
Solution:   Ignore the difference between "sbin" and "bin".

src/testdir/test_functions.vim
src/version.c

index 89db16180292222d8604e394c8ae9e1d856f1dd9..b82f72fd028c5f221c5b1f6510f4c1a5394a6890 100644 (file)
@@ -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'
index 92d4573fe931eb82d60bc24b01ccead92defd44e..5ebda4692b3e971adbf9242e82017c6dd4a85f0b 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2259,
 /**/
     2258,
 /**/