From 4db2a4d6bcfad98ab6ca2f018084316b648ddde0 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Fri, 20 Nov 2020 05:09:13 +0000 Subject: [PATCH] Fix output size truncation --- irclog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/irclog.py b/irclog.py index 4d5f20a..24eb05b 100644 --- a/irclog.py +++ b/irclog.py @@ -1073,8 +1073,9 @@ class WebServer: # Try to find the last LF in the previous buffers for i, prevBuf in enumerate(reversed(out)): if (lfPos := prevBuf.rfind(b'\n')) > -1: - out[i] = out[i][:lfPos + 1] - out = out[:i + 1] + j = len(out) - 1 - i + out[j] = out[j][:lfPos + 1] + out = out[:j + 1] break else: # No newline to be found anywhere at all; no output.