summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-04-30 09:23:38 +0000
committerJim Meyering <jim@meyering.net>2002-04-30 09:23:38 +0000
commitd7984a3fdb951be6421e1746ee666115005c14fd (patch)
tree622160db2c121ad678488d0aa5a61a6e0ea2d968 /src
parent17d3a3e28c148a4bf9e74501b059853904e30fdb (diff)
downloadcoreutils-d7984a3fdb951be6421e1746ee666115005c14fd.tar.xz
(compare_files): 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/comm.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/comm.c b/src/comm.c
index 51d4462a9..b22e35553 100644
--- a/src/comm.c
+++ b/src/comm.c
@@ -41,10 +41,8 @@
/* 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 lines that are found only in file 1. */
static int only_file_1;
@@ -176,12 +174,10 @@ compare_files (char **infiles)
order = -1;
else
{
-#ifdef ENABLE_NLS
- if (hard_LC_COLLATE)
+ if (HAVE_SETLOCALE && hard_LC_COLLATE)
order = xmemcoll (thisline[0]->buffer, thisline[0]->length - 1,
thisline[1]->buffer, thisline[1]->length - 1);
else
-#endif
{
size_t len = min (thisline[0]->length, thisline[1]->length) - 1;
order = memcmp (thisline[0]->buffer, thisline[1]->buffer, len);
@@ -230,13 +226,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
-
only_file_1 = 1;
only_file_2 = 1;
both = 1;