mirror of https://github.com/chzyer/readline.git
fix history rewrite replace origin file
This commit is contained in:
parent
d0699b888b
commit
9f55547f9b
|
@ -88,6 +88,11 @@ func (o *opHistory) HistoryRewrite() {
|
||||||
}
|
}
|
||||||
buf.Flush()
|
buf.Flush()
|
||||||
|
|
||||||
|
// replace history file
|
||||||
|
if err = os.Rename(tmpFile, o.cfg.HistoryFile); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if o.fd != nil {
|
if o.fd != nil {
|
||||||
o.fd.Close()
|
o.fd.Close()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue