about summary refs log tree commit diff
path: root/main.odin
diff options
context:
space:
mode:
Diffstat (limited to 'main.odin')
-rw-r--r--main.odin5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.odin b/main.odin
index 0d4c58a..44c2ff1 100644
--- a/main.odin
+++ b/main.odin
@@ -655,8 +655,11 @@ lookup_touches :: proc(db: ^Db, name: string) -> []Touch_Row {
 	if len(by_basename) > 0 {
 		return by_basename
 	}
+	// Substring, not suffix: `why geno2mdb' should reach geno2mdb.main, and the
+	// documented behaviour is a LIKE '%...%' scan.  It was a suffix match
+	// (LIKE '%name'), which could not find a file's own symbols at all.
 	return run_touches(db, fmt.tprintf(TOUCH_QUERY, "s.name like ?1"),
-	                   fmt.tprintf("%%%s", name))
+	                   fmt.tprintf("%%%s%%", name))
 }
 
 run_touches :: proc(db: ^Db, query, name: string) -> []Touch_Row {