From: Francesco Dolcini <francesco@dolcini.it>
To: Franz Schnyder <fra.schnyder@gmail.com>
Cc: u-boot@lists.denx.de, Tom Rini <trini@konsulko.com>,
Francesco Dolcini <francesco.dolcini@toradex.com>,
Rasmus Villemoes <ravi@prevas.dk>,
Franz Schnyder <franz.schnyder@toradex.com>
Subject: Re: [PATCH] board: toradex: Quote variables in `test` cmd expression
Date: Wed, 1 Apr 2026 07:10:27 +0200 [thread overview]
Message-ID: <20260401051027.GA4471@francesco-nb> (raw)
In-Reply-To: <20260331-fix-test-cmd-empty-v1-1-56cb93fc8f43@toradex.com>
On Tue, Mar 31, 2026 at 10:10:10AM +0200, Franz Schnyder wrote:
> From: Franz Schnyder <franz.schnyder@toradex.com>
>
> With correct POSIX handling, unquoted empty variables can turn the
> expression like
> test -n ${fdtfile}
> into
> test -n
>
> The POSIX handling for single argument `test` evaluates it as true,
> so the fallback initialization will be skipped unexpectedly.
> Quoting variable expansions in `test` expressions will always result in
> correct behavior for empty and non-empty values.
> This change was triggered by
> commit 8b0619579b22 ("cmd: test: fix handling of single-argument form of test")
> The aim is to have a less fragile codebase that is not dependent on a
> quirk of the shell implementation.
>
> Use quoted variable expansions in `test` expressions throughout.
>
> Signed-off-by: Franz Schnyder <franz.schnyder@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
next prev parent reply other threads:[~2026-04-01 5:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 8:10 [PATCH] board: toradex: Quote variables in `test` cmd expression Franz Schnyder
2026-04-01 5:10 ` Francesco Dolcini [this message]
2026-04-02 23:30 ` Tom Rini
2026-04-03 8:53 ` Francesco Dolcini
2026-04-09 9:07 ` Rasmus Villemoes
2026-05-04 4:56 ` Francesco Dolcini
2026-05-04 12:15 ` Simon Glass
2026-05-04 17:08 ` Tom Rini
2026-05-04 20:36 ` Tom Rini
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=20260401051027.GA4471@francesco-nb \
--to=francesco@dolcini.it \
--cc=fra.schnyder@gmail.com \
--cc=francesco.dolcini@toradex.com \
--cc=franz.schnyder@toradex.com \
--cc=ravi@prevas.dk \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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.