about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--saneterm/history.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/saneterm/history.py b/saneterm/history.py
index 12882e1..1226446 100644
--- a/saneterm/history.py
+++ b/saneterm/history.py
@@ -34,13 +34,10 @@ class History():
         self.__con.close()
 
     def add_entry(self, fd, entry):
-        exe = self.__get_exec(fd)
-
-        # Strip trailing newline (if any).
+        entry = entry.rstrip('\n')
         if len(entry) == 0:
             return
-        elif entry[-1] == '\n':
-            entry = entry[0:-1]
+        exe = self.__get_exec(fd)
 
         # Insert new entry into table and make sure the **total** amount
         # of entries in the entire table does not exceed self.histsize.