From: Wolfgang Denk Date: Mon, 25 Jul 2011 22:42:18 +0200 Subject: [U-Boot] [PATCH v3 5/7] common: add run_command2 for running simple or hush commands In-Reply-To: <1309364719-16219-6-git-send-email-jason.hobbs@calxeda.com> References: <1309364719-16219-1-git-send-email-jason.hobbs@calxeda.com> <1309364719-16219-6-git-send-email-jason.hobbs@calxeda.com> Message-ID: <20110725204218.6C02C138EED4@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear "Jason Hobbs", In message <1309364719-16219-6-git-send-email-jason.hobbs@calxeda.com> you wrote: > Signed-off-by: Jason Hobbs > --- > changes in v2: > - whitespace correction ... > --- a/common/main.c > +++ b/common/main.c > @@ -333,12 +333,7 @@ void main_loop (void) > int prev = disable_ctrlc(1); /* disable Control C checking */ > # endif > > -# ifndef CONFIG_SYS_HUSH_PARSER > - run_command (p, 0); > -# else > - parse_string_outer(p, FLAG_PARSE_SEMICOLON | > - FLAG_EXIT_FROM_LOOP); > -# endif > + run_command2(p, 0); Indentation seems wrong here - it should be one TAB more to the right? > +int run_command2(const char *cmd, int flag) > +{ > +#ifndef CONFIG_SYS_HUSH_PARSER > + if (run_command(cmd, flag) == -1) > + return 1; > +#else > + if (parse_string_outer(cmd, > + FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0) > + return 1; > +#endif > + return 0; > +} Can we make this inline [in the normal (non-menu) case], please? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "God is a comedian playing to an audience too afraid to laugh." - Voltaire