]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Update 'echo' command to print everything at once. this allows for format...
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 30 Jan 2012 22:48:33 +0000 (22:48 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 30 Jan 2012 22:48:33 +0000 (22:48 +0000)
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

ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c

index febfc000b3fe32ebda74477f47fa6869fada57df..a34b2a9c8463b532f06662608dd6a94feb1f5457 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Main file for Echo shell level 3 function.\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -40,8 +40,12 @@ ShellCommandRunEcho (
   SHELL_STATUS        ShellStatus;\r
   UINTN               ParamCount;\r
   CHAR16              *ProblemParam;\r
+  UINTN               Size;\r
+  CHAR16              *PrintString;\r
 \r
+  Size                = 0;\r
   ProblemParam        = NULL;\r
+  PrintString         = NULL;\r
   ShellStatus         = SHELL_SUCCESS;\r
 \r
   //\r
@@ -96,13 +100,13 @@ ShellCommandRunEcho (
           ; ShellCommandLineGetRawValue(Package, ParamCount) != NULL\r
           ; ParamCount++\r
          ) {\r
+        StrnCatGrow(&PrintString, &Size, ShellCommandLineGetRawValue(Package, ParamCount), 0);\r
         if (ShellCommandLineGetRawValue(Package, ParamCount+1) != NULL) {\r
-          ShellPrintEx(-1, -1, L"%s ", ShellCommandLineGetRawValue(Package, ParamCount));\r
-        } else {\r
-          ShellPrintEx(-1, -1, L"%s", ShellCommandLineGetRawValue(Package, ParamCount));\r
-        }\r
+          StrnCatGrow(&PrintString, &Size, L" ", 0);\r
+        } \r
       }\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CRLF), gShellLevel3HiiHandle);\r
+      ShellPrintEx(-1, -1, L"%s\r\n", PrintString);\r
+      SHELL_FREE_NON_NULL(PrintString);\r
     }\r
 \r
     //\r