Fix the behaviour of the 'run' command
If one command fails, 'run' command should terminate and not execute
any remaining variables.
Signed-off-by: Timo Ketola <timo@exertus.fi>
Tested-by: Wolfgang Denk <wd@denx.de>
Tested-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
diff --git a/common/main.c b/common/main.c
index db181d3..3b9e39a 100644
--- a/common/main.c
+++ b/common/main.c
@@ -1338,7 +1338,8 @@
continue;
}
- rc = cmd_process(flag, argc, argv, &repeatable);
+ if (cmd_process(flag, argc, argv, &repeatable))
+ rc = -1;
/* Did the user stop this? */
if (had_ctrlc ())