Fixed command line history saving problems

This commit is contained in:
Asmageddon 2012-05-30 20:57:20 +02:00
parent 3cc97accfc
commit 31dd1be090
1 changed files with 5 additions and 2 deletions

View File

@ -455,14 +455,17 @@ class Legacy(BaseMode, component.Component):
#If both are under maximum, it's first, otherwise it's the one not full
if self._hf_lines[0] < MAX_HISTFILE_SIZE and self._hf_lines[1] < MAX_HISTFILE_SIZE:
active_file = 0
if self._hf_lines[0] > self._hf_lines[1]:
elif self._hf_lines[0] == MAX_HISTFILE_SIZE:
active_file = 1
else:
active_file = 0
#Write the line
f = open(self.history_file[active_file], 'a')
f.write( text + os.linesep )
f.write( text.encode('utf-8') )
f.write( os.linesep )
#And increment line counter
self._hf_lines[active_file] += 1