]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
ShellPkg/parse: Handle Unicode stream from pipe correctly
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / Cd.c
index dd4a740354a331839f8868082c62781aaa3f936d..9ae81763f72fd585769ce1943a200b55d8e56239 100644 (file)
@@ -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)) == NULL) {\r
       return TRUE;\r
     } else {\r
       return FALSE;\r