From: Yingke Liu Date: Tue, 23 Jun 2015 06:52:12 +0000 (+0000) Subject: BaseTools: Fix a bug that UNI file can't have comment after #include "file.uni" X-Git-Tag: edk2-stable201903~9591 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=45265a86142fe8259d2b2ba279b1b7b0da814993 BaseTools: Fix a bug that UNI file can't have comment after #include "file.uni" The 'include' regular expression cannot match spaces before or after this statement. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17680 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py index aa54f4fbd6..f900eac1d9 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -293,8 +293,8 @@ class UniFileClassObject(object): if ((Line.count(u'"', 0, CommentPos) - Line.count(u'\\"', 0, CommentPos)) & 1) == 1: CommentPos = Line.find (Comment, CommentPos + 1) else: - return Line[:CommentPos] - return Line + return Line[:CommentPos].strip() + return Line.strip() #