diff --git a/t/test-lib.sh b/t/test-lib.sh index 64390d716d68b79b5a0915a707c95f5c2df39a46..8c57a0059574ff78626ad0e26d3f75da9204b23d 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -884,8 +884,13 @@ then } make_valgrind_symlink () { - # handle only executables - test -x "$1" || return + # handle only executables, unless they are shell libraries that + # need to be in the exec-path. We will just use "#!" as a + # guess for a shell-script, since we have no idea what the user + # may have configured as the shell path. + test -x "$1" || + test "#!" = "$(head -c 2 <"$1")" || + return; base=$(basename "$1") symlink_target=$GIT_BUILD_DIR/$base