From a8549c180a6bc2100425623ea1e317cf65737c8c Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 28 Oct 1995 19:16:14 +0000 Subject: [PATCH] Add setlocale LC_CTYPE Fix icase searches for 8bit charsets --- gnu/usr.bin/grep/grep.c | 6 ++++++ gnu/usr.bin/grep/search.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c index dc3329853307..d7edf122bfd5 100644 --- a/gnu/usr.bin/grep/grep.c +++ b/gnu/usr.bin/grep/grep.c @@ -19,6 +19,9 @@ #include #include +#ifdef __FreeBSD__ +#include +#endif #ifndef errno extern int errno; @@ -606,6 +609,9 @@ main(argc, argv) extern char *optarg; extern int optind; +#ifdef __FreeBSD__ + (void) setlocale(LC_CTYPE, ""); +#endif prog = argv[0]; if (prog && strrchr(prog, '/')) prog = strrchr(prog, '/') + 1; diff --git a/gnu/usr.bin/grep/search.c b/gnu/usr.bin/grep/search.c index 2b8933805c9a..5e17d034abbe 100644 --- a/gnu/usr.bin/grep/search.c +++ b/gnu/usr.bin/grep/search.c @@ -46,7 +46,7 @@ extern char *memchr(); #define bcopy(s, d, n) memcpy((d), (s), (n)) #endif -#ifdef isascii +#if defined(isascii) && !defined(__FreeBSD__) #define ISALNUM(C) (isascii(C) && isalnum(C)) #define ISUPPER(C) (isascii(C) && isupper(C)) #else