Reviewed-by: Jaben Carsey <[email protected]>

> -----Original Message-----
> From: Jeff Westfahl [mailto:[email protected]]
> Sent: Monday, May 15, 2017 10:18 AM
> To: [email protected]
> Cc: Jeff Westfahl <[email protected]>; Ni, Ruiyu <[email protected]>;
> Carsey, Jaben <[email protected]>
> 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 <[email protected]>
> Cc: Jaben Carsey <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jeff Westfahl <[email protected]>
> ---
>  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

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to