summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-08-02 04:48:58 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-08-02 04:48:58 +0000
commit9104fcd3fadb64ceb0ece125e68738a652050200 (patch)
tree521a64294e3f5bffe434de077dc207c333d2aff6
parentd4942b435732988457b69346df2594805b87fb7e (diff)
downloadperl_checker-9104fcd3fadb64ceb0ece125e68738a652050200.tar
perl_checker-9104fcd3fadb64ceb0ece125e68738a652050200.tar.gz
perl_checker-9104fcd3fadb64ceb0ece125e68738a652050200.tar.bz2
perl_checker-9104fcd3fadb64ceb0ece125e68738a652050200.tar.xz
perl_checker-9104fcd3fadb64ceb0ece125e68738a652050200.zip
- workaround bug in ocaml on ultrasparc
(can't catch exception "Fatal error: out-of-bound access in array or string" in native code) - add begins_with in MDK::Common::String
-rw-r--r--perl_checker.src/common.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/perl_checker.src/common.ml b/perl_checker.src/common.ml
index 7d03ffb..c7fe403 100644
--- a/perl_checker.src/common.ml
+++ b/perl_checker.src/common.ml
@@ -770,11 +770,17 @@ let rec string_fold_left f val_ s =
done ;
!val_
+(*
let rec string_forall_with f i s =
try
f s.[i] && string_forall_with f (i+1) s
with Invalid_argument _ -> true
-
+*)
+let string_forall_with f i s =
+ let len = String.length s in
+ let rec string_forall_with_ i =
+ i >= len || f s.[i] && string_forall_with_ (i+1)
+ in string_forall_with_ i
let starts_with_non_lowercase s = s <> "" && s.[0] <> '_' && not (is_lowercase s.[0])