[kvm-unit-tests PATCH] scripts/mkstandalone: fix quoting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Spaces in an argument made the quoted result occupy multiple array
fields after splitting.  The test broke if the third argument was
shifted because of that.  (arm/gicv2*)

Populate the array explicitly, instead of relying on splitting.

Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
---
 scripts/mkstandalone.sh | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index a15941f75375..c1ecb7f99cdc 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -7,13 +7,6 @@ fi
 source config.mak
 source scripts/common.bash
 
-escape ()
-{
-	for arg in "${@}"; do
-		printf "%q " "$arg"; # XXX: trailing whitespace
-	done
-}
-
 temp_file ()
 {
 	local var="$1"
@@ -36,7 +29,10 @@ config_export ()
 
 generate_test ()
 {
-	local args=( $(escape "${@}") )
+	local args=()
+	for arg in "${@}"; do
+		args+=("$(printf "%q" "$arg")")
+	done
 
 	echo "#!/usr/bin/env bash"
 	echo "export STANDALONE=yes"
-- 
2.13.3




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux