ba2c15
From 28793041d7f26a6771837967c495f3ae7ba1134a Mon Sep 17 00:00:00 2001
ba2c15
From: Peter Jones <pjones@redhat.com>
ba2c15
Date: Tue, 13 Mar 2018 15:20:29 -0400
ba2c15
Subject: [PATCH 19/25] Add %D to print device paths
ba2c15
ba2c15
Add %D to print device paths.
ba2c15
ba2c15
Signed-off-by: Peter Jones <pjones@redhat.com>
ba2c15
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
ba2c15
---
ba2c15
 lib/print.c | 13 +++++++++++++
ba2c15
 1 file changed, 13 insertions(+)
ba2c15
ba2c15
diff --git a/lib/print.c b/lib/print.c
ba2c15
index ed79c43825b..35e43c03db5 100644
ba2c15
--- a/lib/print.c
ba2c15
+++ b/lib/print.c
ba2c15
@@ -1005,6 +1005,7 @@ Routine Description:
ba2c15
     t       -   EFI time structure
ba2c15
     g       -   Pointer to GUID
ba2c15
     r       -   EFI status code (result code)
ba2c15
+    D       -   pointer to Device Path with normal ending.
ba2c15
 
ba2c15
     N       -   Set output attribute to normal
ba2c15
     H       -   Set output attribute to highlight
ba2c15
@@ -1167,6 +1168,18 @@ Returns:
ba2c15
                 Item.Item.pw = Item.Scratch;
ba2c15
                 break;
ba2c15
 
ba2c15
+            case 'D':
ba2c15
+            {
ba2c15
+                EFI_DEVICE_PATH *dp = va_arg(ps->args, EFI_DEVICE_PATH *);
ba2c15
+                CHAR16 *dpstr = DevicePathToStr(dp);
ba2c15
+                StrnCpy(Item.Scratch, dpstr, PRINT_ITEM_BUFFER_LEN);
ba2c15
+                Item.Scratch[PRINT_ITEM_BUFFER_LEN-1] = L'\0';
ba2c15
+                FreePool(dpstr);
ba2c15
+
ba2c15
+                Item.Item.pw = Item.Scratch;
ba2c15
+                break;
ba2c15
+            }
ba2c15
+
ba2c15
             case 'f':
ba2c15
                 FloatToString (
ba2c15
                     Item.Scratch,
ba2c15
-- 
ba2c15
2.15.0
ba2c15