forked from mirror/readline
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:
parent
41eea22f71
commit
01c4e90c35
|
@ -117,7 +117,7 @@ func (o *opHistory) rewriteLocked() {
|
||||||
|
|
||||||
buf := bufio.NewWriter(fd)
|
buf := bufio.NewWriter(fd)
|
||||||
for elem := o.history.Front(); elem != nil; elem = elem.Next() {
|
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()
|
buf.Flush()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue