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")