fix: prevent writing empty line to history

windows-fixes
TorchedSammy 2022-03-04 22:04:44 -04:00
parent f26ef935dd
commit 92f279e5cf
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ func newFileHistory() (*fileHistory, error) {
}
func (h *fileHistory) Write(line string) (int, error) {
if line == "" {
return len(h.items), nil
}
_, err := h.f.WriteString(line + "\n")
if err != nil {
return 0, err