From: Filipe Brandenburger Date: Wed, 10 Aug 2016 20:17:12 +0000 (-0700) Subject: tests: Use proper word splitting when executing tests X-Git-Tag: v2.28.1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0155e6f707c2e717033d78854fc869372664c9b1;p=thirdparty%2Futil-linux.git tests: Use proper word splitting when executing tests Use the shell special variable "$@" instead of the inferior $* to execute the test command in ts_valgrind. The expansion of "$@" respects proper word splitting and makes it possible to pass the command empty arguments. It might also prevent surprises with quoting in corner cases. Tested that `make check` passes. Valgrind run with `make check TS_OPTS='--nonroot --memcheck'` passes. Signed-off-by: Filipe Brandenburger --- diff --git a/tests/functions.sh b/tests/functions.sh index 5246605e06..76cf9b5b34 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -367,11 +367,11 @@ function ts_init_py { function ts_valgrind { if [ -z "$TS_VALGRIND_CMD" ]; then - $* + "$@" else $TS_VALGRIND_CMD --tool=memcheck --leak-check=full \ --leak-resolution=high --num-callers=20 \ - --log-file="$TS_VGDUMP" $* + --log-file="$TS_VGDUMP" "$@" fi }