From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd_itest.c: also support environment variables as arguments
Date: Fri, 26 Feb 2010 13:32:05 +0100 [thread overview]
Message-ID: <m2d3zstby2.fsf@ohwell.denx.de> (raw)
In-Reply-To: <1267089747-19776-1-git-send-email-fransmeulenbroeks@gmail.com> (Frans Meulenbroeks's message of "Thu, 25 Feb 2010 10:22:27 +0100")
Hi Frans,
> Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
> ---
> common/cmd_itest.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/common/cmd_itest.c b/common/cmd_itest.c
> index 58c5e7b..78a4082 100644
> --- a/common/cmd_itest.c
> +++ b/common/cmd_itest.c
> @@ -69,6 +69,10 @@ static long evalexp(char *s, int w)
> long l = 0;
> long *p;
>
> + /* if the parameter starts with a $ replace it with the environment value */
> + if (s[0] == '$') {
> + s = getenv(&s[1]);
> + }
This is actually a good idea, but I believe this does not work for the
preferred ${variable} syntax, right?
Cheers
Detlev
--
The management question ... is not _whether_ to build a pilot system
and throw it away. You _will_ do that. The only question is whether to
plan in advance to build a throwaway, or to promise to deliver the
throwaway to customers. - Fred Brooks, "The Mythical Man Month"
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
next prev parent reply other threads:[~2010-02-26 12:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-25 9:22 [U-Boot] [PATCH] cmd_itest.c: also support environment variables as arguments Frans Meulenbroeks
2010-02-26 12:32 ` Detlev Zundel [this message]
2010-02-26 12:42 ` Wolfgang Denk
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=m2d3zstby2.fsf@ohwell.denx.de \
--to=dzu@denx.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox