aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/awk
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1996-10-31 07:45:15 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1996-10-31 07:45:15 +0000
commitd635f7bb20a0211ea463fcd4fc2654aa1475c73a (patch)
tree7e84936449577892db70b91c7ba3c4fc8f4a9e97 /gnu/usr.bin/awk
parent8bd603338f3fec74175a6159881745e4c183c474 (diff)
Notes
Diffstat (limited to 'gnu/usr.bin/awk')
-rw-r--r--gnu/usr.bin/awk/dfa.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gnu/usr.bin/awk/dfa.c b/gnu/usr.bin/awk/dfa.c
index 7a7e8a863c3a..e9c832b540e0 100644
--- a/gnu/usr.bin/awk/dfa.c
+++ b/gnu/usr.bin/awk/dfa.c
@@ -21,9 +21,6 @@
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
-#ifdef __FreeBSD__
-#include <locale.h>
-#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -121,6 +118,23 @@ static char **comsubs _RE_ARGS((char *left, char *right));
static char **addlists _RE_ARGS((char **old, char **new));
static char **inboth _RE_ARGS((char **left, char **right));
+#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
+
static ptr_t
xcalloc(n, s)
size_t n;