]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Revert "ShellPkg: Add Shell[Get|Set]RawCmdLine to ShellCommandLib"
authorRuiyu Ni <ruiyu.ni@intel.com>
Tue, 23 Aug 2016 02:40:42 +0000 (10:40 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 25 Aug 2016 05:00:45 +0000 (13:00 +0800)
This reverts commit 0fcf8d4df85d861b6e721bd1d8abb449f05e15ed.
The above commit causes several regression of "echo" command:
1. Double quotes are not being stripped from the final text. UEFI Shell 2.2 section 3.4.5 chops out the quotes.
2. Output redirection is not working as expected. Text is being redirected, but the ‘> …’ text should not be.
3. Inconsistent special character handling.  For example, comments with # seem to be parsed out correctly, but handing of ^ is incorrect.
In summary, ‘echo “You are ^#1” > t.txt’ results in the below content in t.txt:
 “You are ^#1” > t.txt

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
ShellPkg/Include/Library/ShellCommandLib.h
ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c

index 44eccc447cb269f669e9674d28ac5b3a12dc14c5..5c5e241f1525e03b0a8713cd0dc5a9a83508b15c 100644 (file)
@@ -670,29 +670,6 @@ ShellFileHandleEof(
   IN SHELL_FILE_HANDLE Handle\r
   );\r
 \r
-/**\r
-  Function to get the original CmdLine string for current command.\r
-\r
-  @return     A pointer to the buffer of the original command string.\r
-              It's the caller's responsibility to free the buffer.\r
-**/\r
-CHAR16*\r
-EFIAPI\r
-ShellGetRawCmdLine (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Function to store the orgignal command string into mOriginalCmdLine.\r
-\r
-  @param[in] CmdLine     the command line string to store.\r
-**/\r
-VOID\r
-EFIAPI\r
-ShellSetRawCmdLine (\r
-  IN CONST CHAR16     *CmdLine\r
-  );\r
-\r
 typedef struct {\r
   LIST_ENTRY    Link;\r
   void          *Buffer;\r
index 7fe908cb57cd556c1ef254a066665c75d97bcef9..ac77111ef93c6630e9d53214cd1c527f09e0d989 100644 (file)
@@ -30,7 +30,6 @@ STATIC UINTN                              mProfileListSize;
 STATIC UINTN                              mFsMaxCount = 0;\r
 STATIC UINTN                              mBlkMaxCount = 0;\r
 STATIC BUFFER_LIST                        mFileHandleList;\r
-STATIC CHAR16                             *mRawCmdLine = NULL;\r
 \r
 STATIC CONST CHAR8 Hex[] = {\r
   '0',\r
@@ -1869,50 +1868,6 @@ ShellFileHandleEof(
   return (RetVal);\r
 }\r
 \r
-/**\r
-  Function to get the original CmdLine string for current command.\r
-\r
-  @return     A pointer to the buffer of the original command string.\r
-              It's the caller's responsibility to free the buffer.\r
-**/\r
-CHAR16*\r
-EFIAPI\r
-ShellGetRawCmdLine (\r
-  VOID\r
-  )\r
-{\r
-  if (mRawCmdLine == NULL) {\r
-    return NULL;\r
-  } else {\r
-    return AllocateCopyPool(StrSize(mRawCmdLine), mRawCmdLine);\r
-  }\r
-}\r
-\r
-/**\r
-  Function to store the raw command string.\r
-\r
-  The alias and variables have been replaced and spaces are trimmed.\r
-\r
-  @param[in] CmdLine     the command line string to store.\r
-**/\r
-VOID\r
-EFIAPI\r
-ShellSetRawCmdLine (\r
-  IN CONST CHAR16     *CmdLine\r
-  )\r
-{\r
-  SHELL_FREE_NON_NULL(mRawCmdLine);\r
-\r
-  if (CmdLine != NULL) {\r
-    //\r
-    // The spaces in the beginning and end are trimmed.\r
-    //\r
-    ASSERT (*CmdLine != L' ');\r
-    ASSERT (CmdLine[StrLen (CmdLine) - 1] != L' ');\r
-    mRawCmdLine = AllocateCopyPool (StrSize(CmdLine), CmdLine);\r
-  }\r
-}\r
-\r
 /**\r
   Frees any BUFFER_LIST defined type.\r
 \r