summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-03-30 21:30:56 +0000
committerWolfgang Denk <wd@denx.de>2012-08-09 22:06:23 +0200
commit3a8a02beb75d8b3736d0e40ad4d071413869e363 (patch)
tree1a66c6999706e880411a82fbc8f42ed8d1a1bf0d
parentd51004a832a9784f4c6af5482d4dace6bfd938c4 (diff)
Allow newlines within command environment vars
Any environment variable can hold commands to be executed by the 'run' command. The environment variables preboot, bootcmd and menucmd have special code for triggering execution in certain circumstances. We adjust these calls to use run_command_list() instead of run_command(). This change permits these variables to have embedded newlines so that they work the same as the 'source' command. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--common/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/main.c b/common/main.c
index d96ba0a891f..94059225735 100644
--- a/common/main.c
+++ b/common/main.c
@@ -334,7 +334,7 @@ void main_loop (void)
int prev = disable_ctrlc(1); /* disable Control C checking */
# endif
- run_command(p, 0);
+ run_command_list(p, -1, 0);
# ifdef CONFIG_AUTOBOOT_KEYED
disable_ctrlc(prev); /* restore Control C checking */
@@ -382,7 +382,7 @@ void main_loop (void)
int prev = disable_ctrlc(1); /* disable Control C checking */
# endif
- run_command(s, 0);
+ run_command_list(s, -1, 0);
# ifdef CONFIG_AUTOBOOT_KEYED
disable_ctrlc(prev); /* restore Control C checking */
@@ -393,7 +393,7 @@ void main_loop (void)
if (menukey == CONFIG_MENUKEY) {
s = getenv("menucmd");
if (s)
- run_command(s, 0);
+ run_command_list(s, -1, 0);
}
#endif /* CONFIG_MENUKEY */
#endif /* CONFIG_BOOTDELAY */