Remove the redundant '\' char in file name string returned from 
FileHandleGetFileName.

Cc: Jaben Carsey <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
---
 MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c 
b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
index f6cbfad..4223796 100644
--- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
+++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
@@ -856,6 +856,10 @@ FileHandleGetFileName (
     *FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"\\", 0);
   }
 
+  if (*FullFileName != NULL && (*FullFileName)[StrLen(*FullFileName) - 1] == 
L'\\' && StrLen(*FullFileName) > 1) {
+         (*FullFileName)[StrLen(*FullFileName) - 1] = 0;
+  }
+
   if (CurrentHandle != NULL) {
     CurrentHandle->Close (CurrentHandle);
   }
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to