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 27, 2024
1 parent e28ee8a commit e563844
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 @@ -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 {
Expand Down

0 comments on commit e563844

Please sign in to comment.