Skip to content

Commit 1a4692c

Browse files
committed
Filter entries that start with whitespace
1 parent 9aad030 commit 1a4692c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/history/file_backed.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,14 @@ impl History for FileBackedHistory {
246246
let mut from_file = reader
247247
.lines()
248248
.map(|o| o.map(|i| decode_entry(&i)))
249+
.filter(|e| {
250+
if let Ok(entry) = e {
251+
if entry.starts_with(' ') {
252+
return false;
253+
}
254+
}
255+
true
256+
})
249257
.collect::<std::io::Result<VecDeque<_>>>()?;
250258
if from_file.len() + own_entries.len() > self.capacity {
251259
(

0 commit comments

Comments
 (0)