
Dear "Jason Hobbs",
In message 1307386599-4256-2-git-send-email-jason.hobbs@calxeda.com you wrote:
Signed-off-by: Jason Hobbs jason.hobbs@calxeda.com
common/hush.c | 2 +- common/main.c | 46 +++++++++++++++++++--------------------------- include/common.h | 1 + include/hush.h | 2 +- 4 files changed, 22 insertions(+), 29 deletions(-)
...
index dcbacc9..7da6604 100644 --- a/common/main.c +++ b/common/main.c @@ -342,12 +342,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 looks incorrect here?
-# endif
}
if (s)
run_command2(s, 0);
Indentation always by TABs please.
+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;
Why do you make this function return int when there is no tesing of the return code anywhere?
And why do you make this not an inline function (or macro) so the compiler could avoid the function call overhead?
Best regards,
Wolfgang Denk