From eefe286b7b7a3e22338f9d347dc61b43497a8269 Mon Sep 17 00:00:00 2001 From: jcarsey Date: Mon, 30 Jan 2012 22:48:33 +0000 Subject: [PATCH] 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 --- .../Library/UefiShellLevel3CommandsLib/Echo.c | 16 ++++++++++------ 1 file 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.
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
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); } //