summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-10-31 05:14:27 +0000
committerache <ache@FreeBSD.org>1996-10-31 05:14:27 +0000
commit65a878920f3a8f879630c05fd76f77be3fbab4ac (patch)
treed5a1635da61f2008cd3bed848b5c32aa5c107fe2 /gnu
parent1890d8d6a5941127257717012752b788e83ede8f (diff)
downloadFreeBSD-src-65a878920f3a8f879630c05fd76f77be3fbab4ac.zip
FreeBSD-src-65a878920f3a8f879630c05fd76f77be3fbab4ac.tar.gz
Replace collate_range_cmp with its code (GNU variant)
Diffstat (limited to 'gnu')
-rw-r--r--gnu/lib/libregex/regex.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gnu/lib/libregex/regex.c b/gnu/lib/libregex/regex.c
index 956d2f5..ded13c5 100644
--- a/gnu/lib/libregex/regex.c
+++ b/gnu/lib/libregex/regex.c
@@ -125,10 +125,6 @@ init_syntax_once ()
#endif /* not emacs */
-#ifdef __FreeBSD__
-#include <locale.h>
-#endif
-
/* Get the interface, including the syntax bits. */
#include "regex.h"
@@ -1117,6 +1113,23 @@ static boolean group_in_compile_stack _RE_ARGS((compile_stack_type
compile_stack,
regnum_t regnum));
+#ifdef __FreeBSD__
+static int collate_range_cmp (a, b)
+ int a, b;
+{
+ int r;
+ static char s[2][2];
+
+ if ((unsigned char)a == (unsigned char)b)
+ return 0;
+ s[0][0] = a;
+ s[1][0] = b;
+ if ((r = strcoll(s[0], s[1])) == 0)
+ r = (unsigned char)a - (unsigned char)b;
+ return r;
+}
+#endif
+
/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
Returns one of error codes defined in `regex.h', or zero for success.
OpenPOWER on IntegriCloud