Skip to content

Commit

Permalink
check only first 20 lines for Separator
Browse files Browse the repository at this point in the history
  • Loading branch information
jankoslavic committed May 15, 2024
1 parent c35c7fb commit 9c734d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lvm_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ def _lvm_dump(lvm_data, filename, protocol=-1):

def _get_separator(file):
separator = '\t'
i = 0
for line in file:
if line.startswith('Separator'):
separator = line.strip()[9]
break
if i>20:
break
i+=1

if isinstance(file, io.IOBase):
file.seek(0)
return separator
Expand Down

0 comments on commit 9c734d8

Please sign in to comment.