theory:/path/t.theory into theory:/path/t/index.theory
when cic:/path/t/ exists *)
method private normalize_key key =
- if Pcre.pmatch ~rex:index_RE key then
+ if Pcre.pmatch ~rex:index_RE key &&
+ (try ignore (Dbm.find db key); false with Not_found -> true)
+ then
(* we substitute /index.theory with .theory *)
String.sub key 0 (String.length key - 13) ^ ".theory"
else key