Bugfix in rewriteHistory (#121)

Previously, rewriteHistory was incorrect - it did not preserve the
newlines between history lines, which corrupts the history file.
This commit is contained in:
Jordan Lewis 2017-10-01 22:53:35 -05:00 committed by chzyer
parent 41eea22f71
commit 01c4e90c35
1 changed files with 1 additions and 1 deletions

View File

@ -117,7 +117,7 @@ func (o *opHistory) rewriteLocked() {
buf := bufio.NewWriter(fd)
for elem := o.history.Front(); elem != nil; elem = elem.Next() {
buf.WriteString(string(elem.Value.(*hisItem).Source))
buf.WriteString(string(elem.Value.(*hisItem).Source) + "\n")
}
buf.Flush()