]> git.phdru.name Git - dotfiles.git/commitdiff
init.py: use only HISTSIZE, not HISTFILESIZE
authorOleg Broytman <phd@phdru.name>
Fri, 3 Jun 2016 12:56:54 +0000 (15:56 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 3 Jun 2016 14:31:54 +0000 (17:31 +0300)
HISTSIZE give the size in lines, HISTFILESIZE in bytes.

lib/python/init.py

index 1313c500d7b00518e14a6bf40e7ee5149a24f526..7377a26912ec83ab2d87abc833b36a211460f244 100644 (file)
@@ -43,15 +43,14 @@ def init():
                 pass  # No such file
 
             def savehist():
-                histfilesize = os.environ.get('HISTFILESIZE') \
-                    or os.environ.get('HISTSIZE')
-                if histfilesize:
+                histsize = os.environ.get('HISTSIZE')
+                if histsize:
                     try:
-                        histfilesize = int(histfilesize)
+                        histsize = int(histsize)
                     except ValueError:
                         pass
                     else:
-                        readline.set_history_length(histfilesize)
+                        readline.set_history_length(histsize)
                 readline.write_history_file(histfile)
 
             import atexit