дзеркало
https://github.com/Hilbis/Hilbish
synced 2025-07-14 14:52:02 +00:00
fix: prevent writing empty line to history
This commit is contained in:
джерело
f26ef935dd
коміт
92f279e5cf
@ -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
|
||||
|
Завантаження…
x
Посилання в новій задачі
Block a user