]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/BuildReport.py
Sync BaseTools Trunk (version r2524) to EDKII main trunk.
[mirror_edk2.git] / BaseTools / Source / Python / build / BuildReport.py
index e20131a3123f48a1b0d027d453c9b476cfbde306..d5ea3bd3e5fa077dc9c2e7eb7e98b480f43dfbcf 100644 (file)
@@ -39,6 +39,7 @@ from Common.DataType import TAB_SLASH
 from Common.DataType import TAB_SPACE_SPLIT\r
 from Common.DataType import TAB_BRG_PCD\r
 from Common.DataType import TAB_BRG_LIBRARY\r
+from Common.DataType import TAB_BACK_SLASH\r
 \r
 ## Pattern to extract contents in EDK DXS files\r
 gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)\r
@@ -191,11 +192,11 @@ def FileLinesSplit(Content=None, MaxLength=None):
         while len(Line.rstrip()) > MaxLength:\r
             LineSpaceIndex = Line.rfind(TAB_SPACE_SPLIT, 0, MaxLength)\r
             LineSlashIndex = Line.rfind(TAB_SLASH, 0, MaxLength)\r
-            LineBreakIndex = MaxLength\r
-            if LineSpaceIndex > LineSlashIndex:\r
-                LineBreakIndex = LineSpaceIndex\r
-            elif LineSlashIndex > LineSpaceIndex:\r
-                LineBreakIndex = LineSlashIndex\r
+            LineBackSlashIndex = Line.rfind(TAB_BACK_SLASH, 0, MaxLength)\r
+            if max(LineSpaceIndex, LineSlashIndex, LineBackSlashIndex) > 0:\r
+                LineBreakIndex = max(LineSpaceIndex, LineSlashIndex, LineBackSlashIndex)\r
+            else:\r
+                LineBreakIndex = MaxLength\r
             NewContentList.append(Line[:LineBreakIndex])\r
             Line = Line[LineBreakIndex:]\r
         if Line:\r