public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: Jeff Westfahl <jeff.westfahl@ni.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Ni, Ruiyu" <ruiyu.ni@intel.com>
Subject: Re: [PATCH v2] ShellPkg/Ls: Handle path specified from root
Date: Mon, 15 May 2017 18:00:48 +0000	[thread overview]
Message-ID: <CB6E33457884FA40993F35157061515C630BEFA5@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <1494868679-12262-1-git-send-email-jeff.westfahl@ni.com>

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: Jeff Westfahl [mailto:jeff.westfahl@ni.com]
> Sent: Monday, May 15, 2017 10:18 AM
> To: edk2-devel@lists.01.org
> Cc: Jeff Westfahl <jeff.westfahl@ni.com>; Ni, Ruiyu <ruiyu.ni@intel.com>;
> Carsey, Jaben <jaben.carsey@intel.com>
> Subject: [edk2][PATCH v2] ShellPkg/Ls: Handle path specified from root
> Importance: High
> 
> 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 | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> index 8d33392..8eeb2c0 100644
> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> @@ -685,6 +685,9 @@ ShellCommandRunLs (
>                  ShellCommandLineFreeVarList (Package);
>                  return SHELL_OUT_OF_RESOURCES;
>                }
> +              if (PathName[0] == L'\\') {
> +                while (PathRemoveLastItem(FullPath)) ;
> +              }
>                Size = FullPath != NULL? StrSize(FullPath) : 0;
>                StrnCatGrow(&FullPath, &Size, L"\\", 0);
>              }
> --
> 2.7.4



      reply	other threads:[~2017-05-15 18:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 17:17 [PATCH v2] ShellPkg/Ls: Handle path specified from root Jeff Westfahl
2017-05-15 18:00 ` Carsey, Jaben [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=CB6E33457884FA40993F35157061515C630BEFA5@FMSMSX103.amr.corp.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