This fixes a build "hang" we've experienced after a recent EDK2 update.  Thank 
you!  

Please consider this patch for commit to master

Thomas

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Yonghong 
Zhu
Sent: Tuesday, May 10, 2016 5:17 AM
To: [email protected]
Cc: Liming Gao <[email protected]>
Subject: [edk2] [Patch] BaseTools: fix a bug for uni file \x####\ format 
handling

It should start from the last '\x' position + 1 to find next '\x'
character.

Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <[email protected]>
---
 BaseTools/Source/Python/AutoGen/UniClassObject.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py 
b/BaseTools/Source/Python/AutoGen/UniClassObject.py
index d28fd3a..183b2b2 100644
--- a/BaseTools/Source/Python/AutoGen/UniClassObject.py
+++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py
@@ -442,11 +442,11 @@ class UniFileClassObject(object):
                         if EndStr.startswith(u'\\x') and len(EndStr) >= 7:
                             if EndStr[6] == u'\\' and 
re.match('[a-fA-F0-9]{4}', EndStr[2 : 6], re.UNICODE):
                                 Line = Line[0 : StartPos] + UniStr + EndStr
                         else:
                             Line = Line[0 : StartPos] + UniStr + EndStr[1:]
-                StartPos = Line.find(u'\\x', StartPos)
+                StartPos = Line.find(u'\\x', StartPos + 1)
 
             IncList = gIncludePattern.findall(Line)
             if len(IncList) == 1:
                 for Dir in [File.Dir] + self.IncludePathList:
                     IncFile = PathClass(str(IncList[0]), Dir)
-- 
2.6.1.windows.1

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

Reply via email to