]> xenbits.xen.org Git - xenclient/ocaml.git/commitdiff
temporarily fix the is_printable version. origin/master
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Wed, 7 Jan 2009 18:19:28 +0000 (18:19 +0000)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Wed, 7 Jan 2009 18:19:28 +0000 (18:19 +0000)
we got some issue with locales from the ocaml environment, and since we don't need locale support,
and probably never will, we just provide a ascii version of the function.

byterun/str.c

index 1d8506b67ba34eeba0755fbbd2badb091c06ebf3..84484a7d6e7dc0c6f3590c48e9ef804763b17162 100644 (file)
@@ -137,6 +137,7 @@ CAMLprim value caml_is_printable(value chr)
 {
   int c;
 
+#if 0
 #ifdef HAS_LOCALE
   static int locale_is_set = 0;
   if (! locale_is_set) {
@@ -146,6 +147,9 @@ CAMLprim value caml_is_printable(value chr)
 #endif
   c = Int_val(chr);
   return Val_bool(isprint(c));
+#endif
+  c = Int_val(chr);
+  return (c >= 32 && c <= 126) ? Val_bool(1) : Val_bool(0);
 }
 
 CAMLprim value caml_bitvect_test(value bv, value n)