[U-Boot] [PATCH 2/2] Allow newlines within command environment vars

Simon Glass sjg at chromium.org
Wed Feb 15 07:07:10 CET 2012


The environment variables preboot, bootcmd and menucmd can hold a command
to execute. This change permits these variables to have newlines so that
they work the same as the 'source' command.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
 common/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/main.c b/common/main.c
index 87f2855..48d6b12 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, strlen(p), 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, strlen(s), 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, strlen(s), 0);
 	}
 #endif /* CONFIG_MENUKEY */
 #endif /* CONFIG_BOOTDELAY */
-- 
1.7.7.3



More information about the U-Boot mailing list