X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Focaml%2Fmathql_interpreter%2Fpattern.ml;h=9809552a034c64d55373c3dfcd771157409b5b3c;hb=6f6b8f33397548319fef9b374f9e9017e7fa151d;hp=5fddf5729b4a9a7e719c9c5970bc0eee31758732;hpb=3d70d837a733b4daed65d7c568f4be08f3c37b54;p=helm.git diff --git a/helm/ocaml/mathql_interpreter/pattern.ml b/helm/ocaml/mathql_interpreter/pattern.ml index 5fddf5729..9809552a0 100644 --- a/helm/ocaml/mathql_interpreter/pattern.ml +++ b/helm/ocaml/mathql_interpreter/pattern.ml @@ -38,7 +38,10 @@ let rec pattern_ex l = [] -> [] | s::tl -> let result = let c = pgc () in - let qq = "select uri from registry where uri ~ '" ^ s ^ "' order by registry.uri asc" in + let quoted_s = + Str.global_substitute (Str.regexp "'") + (function _ -> "\\'") s in + let qq = "select uri from registry where uri ~ '" ^ quoted_s ^ "' order by registry.uri asc" in let res = c#exec (qq) in List.map (function uri -> (List.hd uri,[])) res#get_list (*for i = 0 to res#ntuples do