]> git.saurik.com Git - apple/libc.git/blame - locale/FreeBSD/fix_grouping.c.patch
Libc-498.tar.gz
[apple/libc.git] / locale / FreeBSD / fix_grouping.c.patch
CommitLineData
224c7076
A
1--- fix_grouping.c.orig 2004-11-25 11:38:16.000000000 -0800
2+++ fix_grouping.c 2004-12-07 18:11:15.000000000 -0800
3@@ -31,7 +31,8 @@
4 #include <limits.h>
5 #include <stddef.h>
6
7-static const char nogrouping[] = { CHAR_MAX, '\0' };
8+static const char nogrouping[] = { '\0' };
9+static const char __nogrouping[] = { CHAR_MAX, '\0' };
10
11 /*
12 * Internal helper used to convert grouping sequences from string
13@@ -84,3 +85,14 @@
14 *dst = '\0';
15 return str;
16 }
17+
18+/*
19+ * internal helpers for SUSv3 compatibility. Since "nogrouping" needs to
20+ * be just an empty string, we provide a routine to substitute __nogrouping
21+ * so we don't have to modify code that expects CHAR_MAX.
22+ */
23+__private_extern__ const char *
24+__fix_nogrouping(const char *str)
25+{
26+ return ((str == NULL || *str == '\0') ? __nogrouping : str);
27+}