mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 01:02:19 +02:00
hush: make run_command() return an error on parsing failure
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)
This commit is contained in:
@@ -3162,7 +3162,7 @@ static int parse_stream_outer(struct in_str *inp, int flag)
|
|||||||
o_string temp=NULL_O_STRING;
|
o_string temp=NULL_O_STRING;
|
||||||
int rcode;
|
int rcode;
|
||||||
#ifdef __U_BOOT__
|
#ifdef __U_BOOT__
|
||||||
int code = 0;
|
int code = 1;
|
||||||
#endif
|
#endif
|
||||||
do {
|
do {
|
||||||
ctx.type = flag;
|
ctx.type = flag;
|
||||||
|
@@ -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) == 0);
|
assert(run_command(" ", 0) == 0);
|
||||||
|
|
||||||
|
assert(run_command("'", 0) == 1);
|
||||||
|
|
||||||
printf("%s: Everything went swimmingly\n", __func__);
|
printf("%s: Everything went swimmingly\n", __func__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user