From 25918452ed5e9d12ea56b3bb2193df9ab96666b1 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Wed, 23 May 2012 08:27:14 +0000 Subject: Sync BaseTools Trunk (version r2524) to EDKII main trunk. Signed-off-by: Liming Gao Reviewed-by: Liu Yingke Reviewed-by: Yurui Zeng git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13353 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/build/BuildReport.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'BaseTools/Source/Python/build') diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index e20131a312..d5ea3bd3e5 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -39,6 +39,7 @@ from Common.DataType import TAB_SLASH from Common.DataType import TAB_SPACE_SPLIT from Common.DataType import TAB_BRG_PCD from Common.DataType import TAB_BRG_LIBRARY +from Common.DataType import TAB_BACK_SLASH ## Pattern to extract contents in EDK DXS files gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL) @@ -191,11 +192,11 @@ def FileLinesSplit(Content=None, MaxLength=None): while len(Line.rstrip()) > MaxLength: LineSpaceIndex = Line.rfind(TAB_SPACE_SPLIT, 0, MaxLength) LineSlashIndex = Line.rfind(TAB_SLASH, 0, MaxLength) - LineBreakIndex = MaxLength - if LineSpaceIndex > LineSlashIndex: - LineBreakIndex = LineSpaceIndex - elif LineSlashIndex > LineSpaceIndex: - LineBreakIndex = LineSlashIndex + LineBackSlashIndex = Line.rfind(TAB_BACK_SLASH, 0, MaxLength) + if max(LineSpaceIndex, LineSlashIndex, LineBackSlashIndex) > 0: + LineBreakIndex = max(LineSpaceIndex, LineSlashIndex, LineBackSlashIndex) + else: + LineBreakIndex = MaxLength NewContentList.append(Line[:LineBreakIndex]) Line = Line[LineBreakIndex:] if Line: -- cgit v1.2.3