mirror of
https://github.com/hohn/sarif-cli.git
synced 2025-12-16 17:23:03 +01:00
fix load_lines: only strip newlines
This commit is contained in:
committed by
=Michael Hohn
parent
8d1aa8f11e
commit
912f75c52a
@@ -11,7 +11,7 @@ def load_lines(root, path, line_from, line_to):
|
||||
fname = os.path.join(root, path)
|
||||
with open(fname, 'r') as file:
|
||||
lines = file.readlines()
|
||||
return [line.strip() for line in lines[line_from-1 : line_to-1+1]]
|
||||
return [line.rstrip("\n\r") for line in lines[line_from-1 : line_to-1+1]]
|
||||
|
||||
def lineinfo(region):
|
||||
""" Return sensible values for start/end line/columns for the possibly empty
|
||||
|
||||
Reference in New Issue
Block a user