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

Hmm, this one still has a bug. The correct folder is listed, but it prints 
the wrong folder name before listing the contents. I'll fix that and post 
again.

Jeff

On Fri, 12 May 2017, Jeff Westfahl wrote:

> 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 22:09 UTC|newest]

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

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=alpine.DEB.2.20.1705121707520.16483@jmw-lm181 \
    --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