From 6c747d9e923406a124820a30ff06076cec43215d Mon Sep 17 00:00:00 2001 From: letouzey Date: Thu, 25 Oct 2007 16:21:14 +0000 Subject: small fix of commit 10188: a string given via Extract Inductive can be empty git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10266 85f007b7-540e-0410-9357-904b9bb8a0f7 --- contrib/extraction/ocaml.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/extraction/ocaml.ml b/contrib/extraction/ocaml.ml index 3326544a1c..f3df9230d0 100644 --- a/contrib/extraction/ocaml.ml +++ b/contrib/extraction/ocaml.ml @@ -95,7 +95,9 @@ let pp_modname mp = str (Common.pp_module mp) let is_infix r = is_inline_custom r && - (let s = find_custom r in s.[0] = '(' && s.[String.length s-1] = ')') + (let s = find_custom r in + let l = String.length s in + l >= 2 && s.[0] = '(' && s.[l-1] = ')') let get_infix r = let s = find_custom r in -- cgit v1.2.3