ECC: fix incomplete comment strip when searching field name in struct.
[people/mcb30/basetools.git] / 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