summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-07-04 10:22:50 +0000
committertjr <tjr@FreeBSD.org>2004-07-04 10:22:50 +0000
commit577b88a8066e49559db825bc0da759071178d6d0 (patch)
tree71d123f63337c507ccf84068a2eec858a51ad90a /gnu
parent4a61cff009f9e19ec6eca6369d42e3b6a57ebd63 (diff)
downloadFreeBSD-src-577b88a8066e49559db825bc0da759071178d6d0.zip
FreeBSD-src-577b88a8066e49559db825bc0da759071178d6d0.tar.gz
Ignore ENABLE_NLS when deciding whether we can use setlocale().
Use the same shortcut as glibc to test for the "C" or "POSIX" locale.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/grep/hard-locale.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gnu/usr.bin/grep/hard-locale.c b/gnu/usr.bin/grep/hard-locale.c
index 1c75b39..9c5da2b 100644
--- a/gnu/usr.bin/grep/hard-locale.c
+++ b/gnu/usr.bin/grep/hard-locale.c
@@ -15,6 +15,8 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#if HAVE_CONFIG_H
# include <config.h>
#endif
@@ -51,7 +53,7 @@ char *alloca ();
int
hard_locale (int category)
{
-#if ! (defined ENABLE_NLS && HAVE_SETLOCALE)
+#if ! HAVE_SETLOCALE
return 0;
#else
@@ -60,7 +62,7 @@ hard_locale (int category)
if (p)
{
-# if defined __GLIBC__ && __GLIBC__ >= 2
+# if defined(__FreeBSD__) || (defined __GLIBC__ && __GLIBC__ >= 2)
if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
hard = 0;
# else
OpenPOWER on IntegriCloud