log, minor bug in reverse log reader, when reading clog files, the beginning of the file isn't detected. found while working on https://github.com/opnsense/core/issues/3831

This commit is contained in:
Ad Schellevis 2019-11-28 15:56:57 +01:00
parent 7a1dc9fc10
commit 0844a5a27b

View File

@ -61,6 +61,8 @@ def reverse_log_reader(filename, block_size=81920, start_pos=None):
data = input_stream.read(block_size) + data
# split stream using begin of line (bol) and end of line (eol)
bol = data.rfind('\n')
if bol == -1:
bol = data.rfind('\u0000')
eol = len(data)
while bol > -1: