public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jeff Westfahl <jeff.westfahl@ni.com>
To: <edk2-devel@lists.01.org>
Cc: Jeff Westfahl <jeff.westfahl@ni.com>,
	Ruiyu Ni <ruiyu.ni@intel.com>,
	"Jaben Carsey" <jaben.carsey@intel.com>
Subject: [PATCH] ShellPkg/Ls: Handle path specified from root
Date: Fri, 12 May 2017 16:31:46 -0500	[thread overview]
Message-ID: <1494624706-14200-1-git-send-email-jeff.westfahl@ni.com> (raw)

This fixes 'ls' when specifying a path from the root, like "ls \" from
within a subfolder. Currently, 'ls' will append the specified path to the
current working directory. The correct behavior is to start from the root
of the currently selected filesystem.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
---
 ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
index 52ae18f..b14bbcd 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
@@ -679,7 +679,7 @@ ShellCommandRunLs (
             // We got a valid fully qualified path or we have a CWD
             //
             ASSERT((FullPath == NULL && Size == 0) || (FullPath != NULL));
-            if (StrStr(PathName, L":") == NULL) {
+            if (PathName [0] != L'\\' && StrStr(PathName, L":") == NULL) {
               StrnCatGrow(&FullPath, &Size, gEfiShellProtocol->GetCurDir(NULL), 0);
               if (FullPath == NULL) {
                 ShellCommandLineFreeVarList (Package);
-- 
2.7.4



             reply	other threads:[~2017-05-12 21:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12 21:31 Jeff Westfahl [this message]
2017-05-12 22:08 ` [PATCH] ShellPkg/Ls: Handle path specified from root Jeff Westfahl

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=1494624706-14200-1-git-send-email-jeff.westfahl@ni.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