From: "Radim Krčmář" <rkrcmar@redhat.com>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Andrew Jones <drjones@redhat.com>
Subject: [kvm-unit-tests PATCH] scripts/mkstandalone: fix quoting
Date: Wed, 26 Jul 2017 10:39:09 +0200 [thread overview]
Message-ID: <20170726083909.30029-1-rkrcmar@redhat.com> (raw)
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@redhat.com>
---
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
next reply other threads:[~2017-07-26 8:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-26 8:39 Radim Krčmář [this message]
2017-07-26 8:49 ` [kvm-unit-tests PATCH] scripts/mkstandalone: fix quoting Andrew Jones
2017-07-26 13:17 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170726083909.30029-1-rkrcmar@redhat.com \
--to=rkrcmar@redhat.com \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.