From: Claudio Sacerdoti Coen Date: Tue, 27 Nov 2007 17:44:11 +0000 (+0000) Subject: Output is now in UTF8 character counts. X-Git-Tag: make_still_working~5755 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=6e097d02321119711847dcfb2ef4488b1684afaf;p=helm.git Output is now in UTF8 character counts. --- diff --git a/helm/software/matita/rottener.ml b/helm/software/matita/rottener.ml index fa09d07d3..27c277664 100644 --- a/helm/software/matita/rottener.ml +++ b/helm/software/matita/rottener.ml @@ -105,9 +105,10 @@ let rotten_script ~fname statement = with Not_found -> assert false in let trailer = (* trailing comment with machine parseable error location *) - let preamble_len = String.length matches.(1) in - sprintf "\n(*\nerror-at: %d-%d\n*)\n" (preamble_len + start_pos) - (preamble_len + start_pos + error_token_len) in + let preamble_len = Glib.Utf8.length matches.(1) in + sprintf "\n(*\nerror-at: %d-%d\n*)\n" + (preamble_len + Stdpp.first_pos target_pos) + (preamble_len + Stdpp.first_pos target_pos + error_token_len) in let script' = sprintf "%s%s%s%s" matches.(1) statement' matches.(3) trailer in let md5 = Digest.to_hex (Digest.string script') in HExtlib.output_file @@ -154,6 +155,6 @@ let handle_localized_exns f arg = eprintf "Error at %d-%d: %s\n%!" loc_begin loc_end (Printexc.to_string exn) let _ = - Random.init 17; + Random.self_init (); handle_localized_exns grep ()