projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
128059b
)
hush: make run_command() return an error on parsing failure
author
Rabin Vincent
<rabin@rab.in>
Wed, 29 Oct 2014 22:21:41 +0000
(23:21 +0100)
committer
Tom Rini
<trini@ti.com>
Fri, 7 Nov 2014 21:27:06 +0000
(16:27 -0500)
run_command() returns success even if the command had a syntax error;
correct this behaviour.
Signed-off-by: Rabin Vincent <rabin@rab.in>
Acked-by: Simon Glass <sjg@chromium.org)
common/cli_hush.c
patch
|
blob
|
history
test/command_ut.c
patch
|
blob
|
history
diff --git
a/common/cli_hush.c
b/common/cli_hush.c
index a07ae717e146cffc1fd7aee850574a8323898f9c..d6439129228c6652a415d94e5c9ce410b0a9a982 100644
(file)
--- a/
common/cli_hush.c
+++ b/
common/cli_hush.c
@@
-3162,7
+3162,7
@@
static int parse_stream_outer(struct in_str *inp, int flag)
o_string temp=NULL_O_STRING;
int rcode;
#ifdef __U_BOOT__
- int code =
0
;
+ int code =
1
;
#endif
do {
ctx.type = flag;
diff --git
a/test/command_ut.c
b/test/command_ut.c
index a4f034179b0fc1cd881836d852ce700503c61c58..926573a39543c816281a879922ce9ca4c83dd3b1 100644
(file)
--- a/
test/command_ut.c
+++ b/
test/command_ut.c
@@
-191,6
+191,8
@@
static int do_ut_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
assert(run_command("", 0) == 0);
assert(run_command(" ", 0) == 0);
+ assert(run_command("'", 0) == 1);
+
printf("%s: Everything went swimmingly\n", __func__);
return 0;
}