summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-30 22:48:33 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-30 22:48:33 +0000
commiteefe286b7b7a3e22338f9d347dc61b43497a8269 (patch)
tree09289fbd1b36842bc74f3b0bdbf6318135e249da
parent94753eb940984221364e4e43bf3023c17f0ad1f9 (diff)
downloadedk2-platforms-eefe286b7b7a3e22338f9d347dc61b43497a8269.tar.xz
ShellPkg: Update 'echo' command to print everything at once. this allows for format color coding on the output.
signed-off-by: jcarsey reviewed-by: darylm503 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12969 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c
index febfc000b3..a34b2a9c84 100644
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c
+++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c
@@ -1,7 +1,7 @@
/** @file
Main file for Echo shell level 3 function.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -40,8 +40,12 @@ ShellCommandRunEcho (
SHELL_STATUS ShellStatus;
UINTN ParamCount;
CHAR16 *ProblemParam;
+ UINTN Size;
+ CHAR16 *PrintString;
+ Size = 0;
ProblemParam = NULL;
+ PrintString = NULL;
ShellStatus = SHELL_SUCCESS;
//
@@ -96,13 +100,13 @@ ShellCommandRunEcho (
; ShellCommandLineGetRawValue(Package, ParamCount) != NULL
; ParamCount++
) {
+ StrnCatGrow(&PrintString, &Size, ShellCommandLineGetRawValue(Package, ParamCount), 0);
if (ShellCommandLineGetRawValue(Package, ParamCount+1) != NULL) {
- ShellPrintEx(-1, -1, L"%s ", ShellCommandLineGetRawValue(Package, ParamCount));
- } else {
- ShellPrintEx(-1, -1, L"%s", ShellCommandLineGetRawValue(Package, ParamCount));
- }
+ StrnCatGrow(&PrintString, &Size, L" ", 0);
+ }
}
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CRLF), gShellLevel3HiiHandle);
+ ShellPrintEx(-1, -1, L"%s\r\n", PrintString);
+ SHELL_FREE_NON_NULL(PrintString);
}
//