From 6e097d02321119711847dcfb2ef4488b1684afaf Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 27 Nov 2007 17:44:11 +0000 Subject: [PATCH] Output is now in UTF8 character counts. --- helm/software/matita/rottener.ml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 () -- 2.39.2