summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/grep/dfa.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1996-08-13 14:21:48 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1996-08-13 14:21:48 +0000
commit5dc826672fd3509f058867600d7e669257ac81c4 (patch)
tree2fb5656283f6ae3ff7a7da5ba234bb4d3fb6cdcf /gnu/usr.bin/grep/dfa.c
parente7dc5768169bf7bf4aa72dd54ccdb0c4bc80bbd9 (diff)
downloadsrc-test2-5dc826672fd3509f058867600d7e669257ac81c4.tar.gz
src-test2-5dc826672fd3509f058867600d7e669257ac81c4.zip
Notes
Diffstat (limited to 'gnu/usr.bin/grep/dfa.c')
-rw-r--r--gnu/usr.bin/grep/dfa.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gnu/usr.bin/grep/dfa.c b/gnu/usr.bin/grep/dfa.c
index 0409b1e9db25..2270325e43ae 100644
--- a/gnu/usr.bin/grep/dfa.c
+++ b/gnu/usr.bin/grep/dfa.c
@@ -21,6 +21,9 @@
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
+#ifdef __FreeBSD__
+#include <locale.h>
+#endif
#ifdef STDC_HEADERS
#include <stdlib.h>
@@ -606,6 +609,27 @@ lex()
}
else
c2 = c;
+#ifdef __FreeBSD__
+ { token c3;
+
+ if (collate_range_cmp(c, c2) > 0) {
+ FETCH(c2, "Invalid range");
+ goto skip;
+ }
+
+ for (c3 = 0; c3 < NOTCHAR; ++c3)
+ if ( collate_range_cmp(c, c3) <= 0
+ && collate_range_cmp(c3, c2) <= 0
+ ) {
+ setbit(c3, ccl);
+ if (case_fold)
+ if (ISUPPER(c3))
+ setbit(tolower(c3), ccl);
+ else if (ISLOWER(c3))
+ setbit(toupper(c3), ccl);
+ }
+ }
+#else
while (c <= c2)
{
setbit(c, ccl);
@@ -616,6 +640,7 @@ lex()
setbit(toupper(c), ccl);
++c;
}
+#endif
skip:
;
}