]> git.saurik.com Git - apple/libc.git/blobdiff - locale/FreeBSD/fix_grouping.c.patch
Libc-498.tar.gz
[apple/libc.git] / locale / FreeBSD / fix_grouping.c.patch
diff --git a/locale/FreeBSD/fix_grouping.c.patch b/locale/FreeBSD/fix_grouping.c.patch
new file mode 100644 (file)
index 0000000..96e6e3e
--- /dev/null
@@ -0,0 +1,27 @@
+--- fix_grouping.c.orig        2004-11-25 11:38:16.000000000 -0800
++++ fix_grouping.c     2004-12-07 18:11:15.000000000 -0800
+@@ -31,7 +31,8 @@
+ #include <limits.h>
+ #include <stddef.h>
+-static const char nogrouping[] = { CHAR_MAX, '\0' };
++static const char nogrouping[] = { '\0' };
++static const char __nogrouping[] = { CHAR_MAX, '\0' };
+ /*
+  * Internal helper used to convert grouping sequences from string
+@@ -84,3 +85,14 @@
+       *dst = '\0';
+       return str;
+ }
++
++/*
++ * internal helpers for SUSv3 compatibility.  Since "nogrouping" needs to
++ * be just an empty string, we provide a routine to substitute __nogrouping
++ * so we don't have to modify code that expects CHAR_MAX.
++ */
++__private_extern__ const char *
++__fix_nogrouping(const char *str)
++{
++      return ((str == NULL || *str == '\0') ? __nogrouping : str);
++}