From e439111761a5ca31f2c8c7d0689bd8719769bc8d Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 11 Oct 2022 17:47:48 +0800 Subject: [PATCH] Update mw.py --- class/core/mw.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/class/core/mw.py b/class/core/mw.py index c53f897bc..bad73aa9d 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -595,12 +595,14 @@ def getLastLine(path, num, p=1): count = start_line + num fp = open(path, 'rb') buf = "" - fp.seek(-1, 2) + + fp.seek(0, 2) if fp.read(1) == "\n": - fp.seek(-1, 2) + fp.seek(0, 2) data = [] b = True n = 0 + for i in range(count): while True: newline_pos = str.rfind(str(buf), "\n")