summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-04-30 09:25:37 +0000
committerJim Meyering <jim@meyering.net>2002-04-30 09:25:37 +0000
commit9d64f63aaaee974b26d74fed7e1524ef4464cc97 (patch)
tree2f34e826a76cd81a8c2c8297c42de422e438ff94 /src
parentd7984a3fdb951be6421e1746ee666115005c14fd (diff)
downloadcoreutils-9d64f63aaaee974b26d74fed7e1524ef4464cc97.tar.xz
(keycmp): Replace #ifdef ENABLE_NLS with if (HAVE_SETLOCALE).
(hard_LC_COLLATE): Define even if ! ENABLE_NLS. (main): Always initialize hard_LC_COLLATE. Put initialization next to other locale-related stuff.
Diffstat (limited to 'src')
-rw-r--r--src/join.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/join.c b/src/join.c
index 0a5399b1e..94417db19 100644
--- a/src/join.c
+++ b/src/join.c
@@ -88,10 +88,8 @@ struct seq
/* The name this program was run with. */
char *program_name;
-#ifdef ENABLE_NLS
/* Nonzero if the LC_COLLATE locale is hard. */
static int hard_LC_COLLATE;
-#endif
/* If nonzero, print unpairable lines in file 1 or 2. */
static int print_unpairables_1, print_unpairables_2;
@@ -372,10 +370,8 @@ keycmp (struct line *line1, struct line *line2)
}
else
{
-#ifdef ENABLE_NLS
- if (hard_LC_COLLATE)
+ if (HAVE_SETLOCALE && hard_LC_COLLATE)
return xmemcoll ((char *) beg1, len1, (char *) beg2, len2);
-#endif
diff = memcmp (beg1, beg2, min (len1, len2));
}
@@ -744,13 +740,10 @@ main (int argc, char **argv)
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ hard_LC_COLLATE = hard_locale (LC_COLLATE);
atexit (close_stdout);
-#ifdef ENABLE_NLS
- hard_LC_COLLATE = hard_locale (LC_COLLATE);
-#endif
-
/* Initialize this before parsing options. In parsing options,
it may be increased. */
uni_blank.nfields = 1;