]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
ShellPkg: Follow spec to remove the last '\' char in return name of GetCurDir().
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / Ls.c
index c1e2887aa1fb65c48da32e906939ebcea3a13f76..25bf8ca9e13a124a40ac33bf2293b45e27536f41 100644 (file)
@@ -2,7 +2,7 @@
   Main file for ls shell level 2 function.\r
 \r
   (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -669,6 +669,8 @@ ShellCommandRunLs (
           ASSERT(FullPath == NULL);\r
           StrnCatGrow(&SearchString, NULL, L"*", 0);\r
           StrnCatGrow(&FullPath, NULL, CurDir, 0);\r
+          Size = FullPath != NULL? StrSize(FullPath) : 0;\r
+          StrnCatGrow(&FullPath, &Size, L"\\", 0);\r
         } else {\r
           if (StrStr(PathName, L":") == NULL && gEfiShellProtocol->GetCurDir(NULL) == NULL) {\r
             //\r
@@ -687,6 +689,8 @@ ShellCommandRunLs (
                 ShellCommandLineFreeVarList (Package);\r
                 return SHELL_OUT_OF_RESOURCES;\r
               }\r
+              Size = FullPath != NULL? StrSize(FullPath) : 0;\r
+              StrnCatGrow(&FullPath, &Size, L"\\", 0);\r
             }\r
             StrnCatGrow(&FullPath, &Size, PathName, 0);\r
             if (FullPath == NULL) {\r