public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ruiyu Ni <ruiyu.ni@intel.com>
To: edk2-devel@lists.01.org
Cc: Jaben Carsey <jaben.carsey@intel.com>
Subject: [PATCH 2/3] Revert "ShellPkg: Add Shell[Get|Set]RawCmdLine to ShellCommandLib"
Date: Tue, 23 Aug 2016 10:56:08 +0800	[thread overview]
Message-ID: <20160823025609.468312-3-ruiyu.ni@intel.com> (raw)
In-Reply-To: <20160823025609.468312-1-ruiyu.ni@intel.com>

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>
---
 ShellPkg/Include/Library/ShellCommandLib.h         | 23 -----------
 .../UefiShellCommandLib/UefiShellCommandLib.c      | 45 ----------------------
 2 files changed, 68 deletions(-)

diff --git a/ShellPkg/Include/Library/ShellCommandLib.h b/ShellPkg/Include/Library/ShellCommandLib.h
index 44eccc4..5c5e241 100644
--- a/ShellPkg/Include/Library/ShellCommandLib.h
+++ b/ShellPkg/Include/Library/ShellCommandLib.h
@@ -670,29 +670,6 @@ ShellFileHandleEof(
   IN SHELL_FILE_HANDLE Handle
   );
 
-/**
-  Function to get the original CmdLine string for current command.
-
-  @return     A pointer to the buffer of the original command string.
-              It's the caller's responsibility to free the buffer.
-**/
-CHAR16*
-EFIAPI
-ShellGetRawCmdLine (
-  VOID
-  );
-
-/**
-  Function to store the orgignal command string into mOriginalCmdLine.
-
-  @param[in] CmdLine     the command line string to store.
-**/
-VOID
-EFIAPI
-ShellSetRawCmdLine (
-  IN CONST CHAR16     *CmdLine
-  );
-
 typedef struct {
   LIST_ENTRY    Link;
   void          *Buffer;
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
index 7fe908c..ac77111 100644
--- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
+++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
@@ -30,7 +30,6 @@ STATIC UINTN                              mProfileListSize;
 STATIC UINTN                              mFsMaxCount = 0;
 STATIC UINTN                              mBlkMaxCount = 0;
 STATIC BUFFER_LIST                        mFileHandleList;
-STATIC CHAR16                             *mRawCmdLine = NULL;
 
 STATIC CONST CHAR8 Hex[] = {
   '0',
@@ -1870,50 +1869,6 @@ ShellFileHandleEof(
 }
 
 /**
-  Function to get the original CmdLine string for current command.
-
-  @return     A pointer to the buffer of the original command string.
-              It's the caller's responsibility to free the buffer.
-**/
-CHAR16*
-EFIAPI
-ShellGetRawCmdLine (
-  VOID
-  )
-{
-  if (mRawCmdLine == NULL) {
-    return NULL;
-  } else {
-    return AllocateCopyPool(StrSize(mRawCmdLine), mRawCmdLine);
-  }
-}
-
-/**
-  Function to store the raw command string.
-
-  The alias and variables have been replaced and spaces are trimmed.
-
-  @param[in] CmdLine     the command line string to store.
-**/
-VOID
-EFIAPI
-ShellSetRawCmdLine (
-  IN CONST CHAR16     *CmdLine
-  )
-{
-  SHELL_FREE_NON_NULL(mRawCmdLine);
-
-  if (CmdLine != NULL) {
-    //
-    // The spaces in the beginning and end are trimmed.
-    //
-    ASSERT (*CmdLine != L' ');
-    ASSERT (CmdLine[StrLen (CmdLine) - 1] != L' ');
-    mRawCmdLine = AllocateCopyPool (StrSize(CmdLine), CmdLine);
-  }
-}
-
-/**
   Frees any BUFFER_LIST defined type.
 
   @param[in] List     The BUFFER_LIST object to free.
-- 
2.9.0.windows.1



  parent reply	other threads:[~2016-08-23  2:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23  2:56 [PATCH 0/3] Revert "ShellPkg: Fix echo to support displaying special characters" Ruiyu Ni
2016-08-23  2:56 ` [PATCH 1/3] " Ruiyu Ni
2016-08-23  2:56 ` Ruiyu Ni [this message]
2016-08-23  2:56 ` [PATCH 3/3] Revert "ShellPkg: Move FindFirstCharacter/GetNextParameter to ShellCommandLib" Ruiyu Ni
2016-08-23 13:45   ` Shah, Tapan
2016-08-24 15:09   ` Shah, Tapan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160823025609.468312-3-ruiyu.ni@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox