Skip to content

Commit 16ea409

Browse files
authored
Merge pull request #2 from talhaHavadar/master
Add support for parsing bitfields with spaces between column.
2 parents e804880 + 3e87fd8 commit 16ea409

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dissect/cstruct/cstruct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def _structs(self, data):
401401

402402
def _parse_fields(self, s):
403403
fields = re.finditer(
404-
r'(?P<type>[^\s]+)\s+(?P<name>[^\s\[:]+)(:(?P<bits>\d+))?(\[(?P<count>[^;\n]*)\])?;',
404+
r'(?P<type>[^\s]+)\s+(?P<name>[^\s\[:]+)(\s*:\s*(?P<bits>\d+))?(\[(?P<count>[^;\n]*)\])?;',
405405
s,
406406
)
407407
r = []

0 commit comments

Comments
 (0)