ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
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 > > _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
© 2016 - 2024 Red Hat, Inc.