Skip to content

Commit 361fa32

Browse files
avargitster
authored andcommitted
test-lib.sh: fix prepend_var() quoting issue
Fix a quoting issue in the function introduced in b9638d7 (test-lib: make $GIT_BUILD_DIR an absolute path, 2022-02-27), running the test suite where the git checkout was on a path with e.g. a space in it would fail. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 386e7a9 commit 361fa32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/test-lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ fi
5757
#
5858
# prepend_var VAR : VALUE
5959
prepend_var () {
60-
eval "$1=$3\${$1:+${3:+$2}\$$1}"
60+
eval "$1=\"$3\${$1:+${3:+$2}\$$1}\""
6161
}
6262

6363
# If [AL]SAN is in effect we want to abort so that we notice
6464
# problems. The GIT_SAN_OPTIONS variable can be used to set common
6565
# defaults shared between [AL]SAN_OPTIONS.
6666
prepend_var GIT_SAN_OPTIONS : abort_on_error=1
67-
prepend_var GIT_SAN_OPTIONS : strip_path_prefix=\"$GIT_BUILD_DIR/\"
67+
prepend_var GIT_SAN_OPTIONS : strip_path_prefix="$GIT_BUILD_DIR/"
6868

6969
# If we were built with ASAN, it may complain about leaks
7070
# of program-lifetime variables. Disable it by default to lower

0 commit comments

Comments
 (0)