Skip to content

Commit

Permalink
Merge pull request #2 from talhaHavadar/master
Browse files Browse the repository at this point in the history
Add support for parsing bitfields with spaces between column.
  • Loading branch information
Schamper authored Mar 4, 2019
2 parents e804880 + 3e87fd8 commit 16ea409
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dissect/cstruct/cstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def _structs(self, data):

def _parse_fields(self, s):
fields = re.finditer(
r'(?P<type>[^\s]+)\s+(?P<name>[^\s\[:]+)(:(?P<bits>\d+))?(\[(?P<count>[^;\n]*)\])?;',
r'(?P<type>[^\s]+)\s+(?P<name>[^\s\[:]+)(\s*:\s*(?P<bits>\d+))?(\[(?P<count>[^;\n]*)\])?;',
s,
)
r = []
Expand Down

0 comments on commit 16ea409

Please sign in to comment.