Skip to content

Commit

Permalink
Bugfix in rewriteHistory (#121)
Browse files Browse the repository at this point in the history
Previously, rewriteHistory was incorrect - it did not preserve the
newlines between history lines, which corrupts the history file.
  • Loading branch information
jordanlewis authored and chzyer committed Oct 2, 2017
1 parent 41eea22 commit 01c4e90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion history.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 01c4e90

Please sign in to comment.