From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Fri, 26 Feb 2010 13:32:05 +0100 Subject: [U-Boot] [PATCH] cmd_itest.c: also support environment variables as arguments 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") References: <1267089747-19776-1-git-send-email-fransmeulenbroeks@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Frans, > Signed-off-by: Frans Meulenbroeks > --- > 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