Commit 3a8a02beb75d8b3736d0e40ad4d071413869e363
Committed by
Wolfgang Denk
1 parent
d51004a832
Exists in
master
and in
54 other branches
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>
Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff
common/main.c
... | ... | @@ -334,7 +334,7 @@ |
334 | 334 | int prev = disable_ctrlc(1); /* disable Control C checking */ |
335 | 335 | # endif |
336 | 336 | |
337 | - run_command(p, 0); | |
337 | + run_command_list(p, -1, 0); | |
338 | 338 | |
339 | 339 | # ifdef CONFIG_AUTOBOOT_KEYED |
340 | 340 | disable_ctrlc(prev); /* restore Control C checking */ |
... | ... | @@ -382,7 +382,7 @@ |
382 | 382 | int prev = disable_ctrlc(1); /* disable Control C checking */ |
383 | 383 | # endif |
384 | 384 | |
385 | - run_command(s, 0); | |
385 | + run_command_list(s, -1, 0); | |
386 | 386 | |
387 | 387 | # ifdef CONFIG_AUTOBOOT_KEYED |
388 | 388 | disable_ctrlc(prev); /* restore Control C checking */ |
... | ... | @@ -393,7 +393,7 @@ |
393 | 393 | if (menukey == CONFIG_MENUKEY) { |
394 | 394 | s = getenv("menucmd"); |
395 | 395 | if (s) |
396 | - run_command(s, 0); | |
396 | + run_command_list(s, -1, 0); | |
397 | 397 | } |
398 | 398 | #endif /* CONFIG_MENUKEY */ |
399 | 399 | #endif /* CONFIG_BOOTDELAY */ |