summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-05-28 08:06:31 +0000
committerwdenk <wdenk>2003-05-28 08:06:31 +0000
commitf07771cc288eb86cad8f8a5c1aa593caf2ba26f8 (patch)
tree346fafd730e6ec3b9fb134d025257552ecdd7d69 /common
parent38b99261c13a54ea955a8fe9176e73256486362f (diff)
* Fix data abort exception handling for arm920t CPU
* Fix alignment problems with flash driver for TRAB board * Patch by Donald White, 21 May 2003: fix calculation of base address in pci_hose_config_device() * Fix bug in command line parsing: "cmd1;cmd2" is supposed to always execute "cmd2", even if "cmd1" fails. Note that this is different to "run var1 var2" where the contents of "var2" will NOT be executed when a command in "var1" fails.
Diffstat (limited to 'common')
-rw-r--r--common/main.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/common/main.c b/common/main.c
index fe4ebb4f662..6192dff365c 100644
--- a/common/main.c
+++ b/common/main.c
@@ -746,9 +746,9 @@ int run_command (const char *cmd, int flag)
char finaltoken[CFG_CBSIZE];
char *str = cmdbuf;
char *argv[CFG_MAXARGS + 1]; /* NULL terminated */
- int argc;
+ int argc, inquotes;
int repeatable = 1;
- int inquotes;
+ int rc = 0;
#ifdef DEBUG_PARSER
printf ("[RUN_COMMAND] cmd[%p]=\"", cmd);
@@ -817,13 +817,15 @@ int run_command (const char *cmd, int flag)
/* Look up command in command table */
if ((cmdtp = find_cmd(argv[0])) == NULL) {
printf ("Unknown command '%s' - try 'help'\n", argv[0]);
- return -1; /* give up after bad command */
+ rc = -1; /* give up after bad command */
+ continue;
}
/* found - check max args */
if (argc > cmdtp->maxargs) {
printf ("Usage:\n%s\n", cmdtp->usage);
- return -1;
+ rc = -1;
+ continue;
}
#if (CONFIG_COMMANDS & CFG_CMD_BOOTD)
@@ -834,7 +836,8 @@ int run_command (const char *cmd, int flag)
#endif
if (flag & CMD_FLAG_BOOTD) {
printf ("'bootd' recursion detected\n");
- return -1;
+ rc = -1;
+ continue;
}
else
flag |= CMD_FLAG_BOOTD;
@@ -843,7 +846,7 @@ int run_command (const char *cmd, int flag)
/* OK - call function to do the command */
if ((cmdtp->cmd) (cmdtp, flag, argc, argv) != 0) {
- return (-1);
+ rc = -1;
}
repeatable &= cmdtp->repeatable;
@@ -853,7 +856,7 @@ int run_command (const char *cmd, int flag)
return 0; /* if stopped then not repeatable */
}
- return repeatable;
+ return rc ? rc : repeatable;
}
/****************************************************************************/