ECC: fix incomplete comment strip when searching field name in struct.
authorjlin16 <jlin16@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 16 Jul 2008 03:36:45 +0000 (03:36 +0000)
committerjlin16 <jlin16@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 16 Jul 2008 03:36:45 +0000 (03:36 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1285 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Ecc/c.py

index 6fce201..016efc1 100644 (file)
@@ -882,8 +882,11 @@ def StripComments(Str):
     List = Str.splitlines()\r
     InComment = False\r
     for StrPart in List:\r
-        if StrPart.lstrip().startswith('//'):\r
+        Index = StrPart.find('//')\r
+        if Index != -1 and not InComment:\r
+            StrippedStr += StrPart[0:Index]\r
             continue\r
+        \r
         Index = StrPart.find('/*')\r
         if Index != -1:\r
             InComment = True\r