Commit 2302b3ab85843c9a8dbb3a924030659d87a23349

Authored by Rabin Vincent
Committed by Tom Rini
1 parent 128059b926

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)

Showing 2 changed files with 3 additions and 1 deletions Side-by-side Diff

... ... @@ -3162,7 +3162,7 @@
3162 3162 o_string temp=NULL_O_STRING;
3163 3163 int rcode;
3164 3164 #ifdef __U_BOOT__
3165   - int code = 0;
  3165 + int code = 1;
3166 3166 #endif
3167 3167 do {
3168 3168 ctx.type = flag;
... ... @@ -191,6 +191,8 @@
191 191 assert(run_command("", 0) == 0);
192 192 assert(run_command(" ", 0) == 0);
193 193  
  194 + assert(run_command("'", 0) == 1);
  195 +
194 196 printf("%s: Everything went swimmingly\n", __func__);
195 197 return 0;
196 198 }