ShellPkg/ls: Display the correct directory path

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
index 6d3cc95..0b80195 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
@@ -442,6 +442,7 @@
       }

 

       if (!Sfo && !HeaderPrinted) {

+        PathRemoveLastItem (CorrectedPath);

         PrintNonSfoHeader(CorrectedPath);

       }

       PrintFileInformation(Sfo, Node, &FileCount, &FileSize, &DirCount);