Skip to content

Commit

Permalink
Use instr for cwd as well
Browse files Browse the repository at this point in the history
  • Loading branch information
sholderbach committed Mar 26, 2024
1 parent 8fa73a7 commit e08f4af
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/history/sqlite_backed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,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 {
Expand Down

0 comments on commit e08f4af

Please sign in to comment.