From e5638446f9b6b83de65cd49de0d778a8ede76385 Mon Sep 17 00:00:00 2001 From: sholderbach Date: Tue, 26 Mar 2024 15:34:40 +0100 Subject: [PATCH] Use `instr` for cwd as well --- src/history/sqlite_backed.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/history/sqlite_backed.rs b/src/history/sqlite_backed.rs index 36d8fc7c..50e678b5 100644 --- a/src/history/sqlite_backed.rs +++ b/src/history/sqlite_backed.rs @@ -349,9 +349,8 @@ impl SqliteBackedHistory { params.push((":cwd", Box::new(cwd_exact))); } if let Some(cwd_prefix) = &query.filter.cwd_prefix { - wheres.push("cwd glob :cwd_like"); - let cwd_like = format!("{cwd_prefix}*"); - params.push((":cwd_like", Box::new(cwd_like))); + wheres.push("instr(cwd, :cwd_like) == 1"); + params.push((":cwd_like", Box::new(cwd_prefix))); } if let Some(exit_successful) = query.filter.exit_successful { if exit_successful {