This commit is contained in:
Costa Shulyupin 2018-08-27 09:41:40 +03:00
parent 9e851e582e
commit 156d98c74c
1 changed files with 5 additions and 1 deletions

View File

@ -520,8 +520,12 @@ def digraph_print(dg, starts=None, dst_fn=None, sort=False):
def cflow_preprocess(a): def cflow_preprocess(a):
with open(a, 'r') as f: with open(a, 'rb') as f:
for s in f: for s in f:
try:
s = s.decode('utf-8')
except UnicodeDecodeError:
s = s.decode('latin1')
# treat struct like function # treat struct like function
s = re.sub(r"^static struct (.*) = ", r"\1()", s) s = re.sub(r"^static struct (.*) = ", r"\1()", s)
s = re.sub(r"^static struct (.*)\[\] = ", r"\1()", s) s = re.sub(r"^static struct (.*)\[\] = ", r"\1()", s)