summaryrefslogtreecommitdiff
path: root/src/searchutils.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-04-08 08:04:36 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-04-08 08:05:16 -0700
commitc74a1d118577e4d3721cd0bcba1a09b8b451f3cc (patch)
treee423d0ba2b3a94231b6be47d1160db125f387360 /src/searchutils.c
parent359012dab9476c8accd3629a8991418a09233b3f (diff)
downloadgrep-c74a1d118577e4d3721cd0bcba1a09b8b451f3cc.tar.gz
grep: port better to hosts with nonstandard nl_langinfo
On some hosts, nl_langinfo returns strings other than "UTF-8" when UTF-8 is used, and (worse) return "UTF-8" even if the encoding is single-byte. Work around these problems by trying a sample character instead. * src/dfa.c, src/pcresearch.c, src/searchutils.c: Don't include <langinfo.h>. * src/dfa.c (using_utf8): Test for UTF-8 by trying a character rather than by invoking nl_langinfo (CODESET); this is more portable in practice, and removes a dependency on HAVE_LANGINFO_CODESET. * src/pcresearch.c: Include dfa.h, for using_utf8. (Pcompile): Use using_utf8 rather than nl_langinfo.
Diffstat (limited to 'src/searchutils.c')
-rw-r--r--src/searchutils.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/searchutils.c b/src/searchutils.c
index 6749945f..6440f073 100644
--- a/src/searchutils.c
+++ b/src/searchutils.c
@@ -20,9 +20,6 @@
#include <assert.h>
#include "search.h"
#include "dfa.h"
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
#define NCHAR (UCHAR_MAX + 1)