]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
ShellPkg/Level2Command: Use UnicodeCollation in StrinCmp
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / Cd.c
index d459a7a67e84787b5f11ae76ae51806e684ebfe0..d5dc9804d4dc33c148bf575e0dc0ee00d6e9f2bb 100644 (file)
@@ -3,7 +3,7 @@
 \r
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2018, 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
@@ -99,10 +99,10 @@ IsCurrentFileSystem (
 \r
   Splitter2 = StrStr (Cwd, L":");\r
 \r
-  if ((UINTN) (Splitter1 - FullPath) != (UINTN) (Splitter2 - Cwd)) {\r
+  if (((UINTN) Splitter1 - (UINTN) FullPath) != ((UINTN) Splitter2 - (UINTN) Cwd)) {\r
     return FALSE;\r
   } else {\r
-    if (StrniCmp (FullPath, Cwd, (UINTN) (Splitter1 - FullPath)) == NULL) {\r
+    if (StrniCmp (FullPath, Cwd, ((UINTN) Splitter1 - (UINTN) FullPath) / sizeof (CHAR16)) == 0) {\r
       return TRUE;\r
     } else {\r
       return FALSE;\r
@@ -321,8 +321,6 @@ ShellCommandRunCd (
             if (EFI_ERROR (Status)) {\r
               ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN(STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cd", Param1Copy);\r
               ShellStatus = SHELL_NOT_FOUND;\r
-            } else {\r
-              ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN(STR_CD_PRINT), gShellLevel2HiiHandle, ShellGetCurrentDir(Drive));\r
             }\r
           }\r
         }\r