]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Use ".." to indicate device path is partially displayed
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 16 Jun 2016 03:12:53 +0000 (11:12 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 17 Jun 2016 07:43:11 +0000 (15:43 +0800)
The output of "dh <handle>" originally is like below:
12C: USBIO DevicePath(x0)/Pci(0x14,0x0)/USB(0x6,0x0))

The device path part is very confusing. Use ".." in front of the
partially displayed device path is better and it also aligns to
the example output in Shell spec.
12C: USBIO DevicePath(..)/Pci(0x14,0x0)/USB(0x6,0x0))

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c

index a81d1f208a2761f4560c35c10feb1352ffa4b4bd..408199166d7e7ff29f305999c498083ad2770a19 100644 (file)
@@ -753,6 +753,7 @@ DevicePathProtocolDumpInformation(
   CHAR16                            *Temp;\r
   CHAR16                            *Temp2;\r
   EFI_STATUS                        Status;\r
+  UINTN                             Size;\r
   Temp = NULL;\r
 \r
   Status = gBS->OpenProtocol(TheHandle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
@@ -765,7 +766,9 @@ DevicePathProtocolDumpInformation(
   }\r
   if (!Verbose && Temp != NULL && StrLen(Temp) > 30) {\r
     Temp2 = NULL;\r
-    Temp2 = StrnCatGrow(&Temp2, NULL, Temp+(StrLen(Temp) - 30), 30);\r
+    Size  = 0;\r
+    Temp2 = StrnCatGrow(&Temp2, &Size, L"..", 0);\r
+    Temp2 = StrnCatGrow(&Temp2, &Size, Temp+(StrLen(Temp) - 28), 0);\r
     FreePool(Temp);\r
     Temp = Temp2;\r
   }\r