]> matita.cs.unibo.it Git - helm.git/commitdiff
Bug fixed: "'" must be quoted.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 4 Feb 2003 12:14:03 +0000 (12:14 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 4 Feb 2003 12:14:03 +0000 (12:14 +0000)
helm/ocaml/mathql_interpreter/pattern.ml

index 5fddf5729b4a9a7e719c9c5970bc0eee31758732..9809552a034c64d55373c3dfcd771157409b5b3c 100644 (file)
@@ -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