Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/2] pkgconf: pkg-config.in: double quote $@
Date: Sun, 25 Feb 2018 22:01:39 +0100	[thread overview]
Message-ID: <20180225220139.23ce4274@windsurf.home> (raw)
In-Reply-To: <20180222224905.28618-1-gael.portay@savoirfairelinux.com>

Hello,

On Thu, 22 Feb 2018 17:49:04 -0500, Ga?l PORTAY wrote:
> The shell expands "$@" as "$1" "$2" "$3"... while it expands $@ as $1 $2
> $3. With the second form, we loses spaces in positional parameters.
> 
> As example, the following call
> 
>         pkg-config --cflags "one two" three
> 
> is wrapped as
> 
>         pkgconf --cflags one two three
> 
> while we are expecting
> 
>         pkgconf --cflags "one two" three
> 
> "$@" is really useful when writing wrappers. It passes the positional
> arguments *as* they are given.
> 
> Double quote $@ to prevent from splitting elements.
> 
> Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
> ---

Both patches applied to next. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  parent reply	other threads:[~2018-02-25 21:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 22:49 [Buildroot] [PATCH v2 1/2] pkgconf: pkg-config.in: double quote $@ Gaël PORTAY
2018-02-22 22:49 ` [Buildroot] [PATCH v2 2/2] pkgconf: pkg-config.in: exec pkgconf Gaël PORTAY
2018-03-30 19:25   ` Peter Korsgaard
2018-02-25 21:01 ` Thomas Petazzoni [this message]
2018-03-30 19:25 ` [Buildroot] [PATCH v2 1/2] pkgconf: pkg-config.in: double quote $@ Peter Korsgaard

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=20180225220139.23ce4274@windsurf.home \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox