forked from OSchip/llvm-project
[scan-build-py] fix some line separator issues
Differential Revision: https://reviews.llvm.org/D30600 llvm-svn: 297266
This commit is contained in:
parent
317c539e19
commit
ed739d902d
|
@ -207,9 +207,9 @@ class Configure(object):
|
|||
if m:
|
||||
key = m.group(1)
|
||||
if key not in definitions or not definitions[key]:
|
||||
return '/* #undef {} */\n'.format(key)
|
||||
return '/* #undef {0} */{1}'.format(key, os.linesep)
|
||||
else:
|
||||
return '#define {}\n'.format(key)
|
||||
return '#define {0}{1}'.format(key, os.linesep)
|
||||
return line
|
||||
|
||||
with open(template, 'r') as src_handle:
|
||||
|
|
|
@ -336,11 +336,12 @@ def parse_crash(filename):
|
|||
|
||||
match = re.match(r'(.*)\.info\.txt', filename)
|
||||
name = match.group(1) if match else None
|
||||
with open(filename) as handler:
|
||||
lines = handler.readlines()
|
||||
with open(filename, mode='rb') as handler:
|
||||
# this is a workaround to fix windows read '\r\n' as new lines.
|
||||
lines = [line.decode().rstrip() for line in handler.readlines()]
|
||||
return {
|
||||
'source': lines[0].rstrip(),
|
||||
'problem': lines[1].rstrip(),
|
||||
'source': lines[0],
|
||||
'problem': lines[1],
|
||||
'file': name,
|
||||
'info': name + '.info.txt',
|
||||
'stderr': name + '.stderr.txt'
|
||||
|
|
Loading…
Reference in New Issue