From efa109b62e688684161536700b5fd1ac67950ed1 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 6 Oct 2024 11:45:53 +0200 Subject: [PATCH] Add default-enabled error log when there is a corrupted history entry We'll drop the corrupted item on the next vacuum, so this shouldn't be too annoying, and hopefully helps to narrow down #10300 further. --- src/history/file.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/history/file.rs b/src/history/file.rs index 3240dd3c5..c087c6409 100644 --- a/src/history/file.rs +++ b/src/history/file.rs @@ -494,6 +494,15 @@ fn offset_of_next_item_fish_2_0( continue; } + if line.starts_with(b"\0") { + FLOG!( + error, + "ignoring corrupted history entry around offset", + *cursor + ); + continue; + } + if !line.starts_with(b"- cmd") { FLOG!( history,