deal with max=0 in the storer
This commit is contained in:
parent
2633e11f53
commit
24d13eb5bc
1 changed files with 2 additions and 1 deletions
|
@ -23,7 +23,8 @@ func store(text string, history []string, histfile string, max int, persist bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// drop oldest items that exceed max list size
|
// drop oldest items that exceed max list size
|
||||||
if l >= max {
|
// if max = 0, we allow infinite history; NOTE: users should NOT rely on this behaviour as we might change it without notice
|
||||||
|
if max != 0 && l >= max {
|
||||||
// usually just one item, but more if we suddenly reduce our --max-items
|
// usually just one item, but more if we suddenly reduce our --max-items
|
||||||
history = history[l-max+1:]
|
history = history[l-max+1:]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue