From 5f83138aed0a0f215100cbb83b0c837a6a594cdb Mon Sep 17 00:00:00 2001 From: Alan Li <61896187+lebr0nli@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:42:51 +0800 Subject: [PATCH] Avoid reading newline while reading history --- gdbinit-gep.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbinit-gep.py b/gdbinit-gep.py index fc75c5b..c79e71c 100644 --- a/gdbinit-gep.py +++ b/gdbinit-gep.py @@ -430,7 +430,7 @@ def load_history_strings(self) -> list[str]: strings = [] if os.path.exists(self.filename): with open(self.filename) as f: - for string in reversed(f.readlines()): + for string in reversed(f.read().splitlines()): if self.ignore_duplicates and string in strings: continue if string: