|
|
@@ -935,7 +935,12 @@ class WebServer: |
|
|
|
# Process grep output with --with-filenames, --null, and --line-number into (path, line) tuples. |
|
|
|
# Lines are sorted by timestamp, filename, and line number to ensure a consistent and chronological order. |
|
|
|
out = [] |
|
|
|
for line in stdout.decode('utf-8').splitlines(): |
|
|
|
# splitlines splits on more than desired, in particular also on various things that can occur within IRC messages (which is really anything except CR LF, basically). |
|
|
|
# split has the downside of producing a final empty element (because stdout ends with LF) and an empty element when the input is empty. |
|
|
|
# So just discard empty lines. |
|
|
|
for line in stdout.decode('utf-8').split('\n'): |
|
|
|
if line == '': |
|
|
|
continue |
|
|
|
fn, line = line.split('\0', 1) |
|
|
|
assert fn.startswith(self.config['storage']['path'] + '/') and fn.count('/', len(self.config['storage']['path']) + 1) == 1 |
|
|
|
_, path, _ = fn.rsplit('/', 2) |
|
|
|