]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/ShellProtocol.c
prevents "" from being the result of trying to open the root of a drive.
[mirror_edk2.git] / ShellPkg / Application / Shell / ShellProtocol.c
index e2da5d37ad2970f54a5df07824622ed67c914160..2d587ea03b1f3838144bd61ce40f17a46841db9c 100644 (file)
@@ -585,7 +585,11 @@ EfiShellGetDevicePathFromFilePath(
   //\r
   // build the full device path\r
   //\r
-  DevicePathForReturn = FileDevicePath(Handle, Path+StrLen(MapName)+1);\r
+  if (*(Path+StrLen(MapName)+1) == CHAR_NULL) {\r
+    DevicePathForReturn = FileDevicePath(Handle, L"\\");\r
+  } else {\r
+    DevicePathForReturn = FileDevicePath(Handle, Path+StrLen(MapName)+1);\r
+  }\r
 \r
   FreePool(MapName);\r
   if (DevicePathCopyForFree != NULL) {\r