bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Localization based problem with sort


From: Dirk Stoecker
Subject: Re: Localization based problem with sort
Date: Mon, 16 Jan 2006 14:18:15 +0100 (CET)

On Fri, 13 Jan 2006, Paul Eggert wrote:

> > What would be the problem when there is an option "--no-dictionary-order" 
> > and "--no-ignore-case"?
> 
> The problem is implementing those options, not specifying them.  I
> don't know how to implement them.  If you could supply a patch to
> implement them, that would help.

What about the following solution? It is not exactly implementing the 
above options, but nevertheless fixes the problem directly:

--- src/sort.c.bak      2006-01-16 13:34:21.000000000 +0100
+++ src/sort.c  2006-01-16 14:15:14.000000000 +0100
@@ -295,6 +295,7 @@
       fputs (_("\
   -g, --general-numeric-sort  compare according to general numerical 
value\n\
   -i, --ignore-nonprinting    consider only printable characters\n\
+  -l, --no-locale-sort        do not sort according to current locale 
settings\n\
   -M, --month-sort            compare (unknown) < `JAN' < ... < `DEC'\n\
   -n, --numeric-sort          compare according to string numerical 
value\n\
   -r, --reverse               reverse the result of comparisons\n\
@@ -347,7 +348,7 @@
   exit (status);
 }

-#define COMMON_SHORT_OPTIONS "-bcdfgik:mMno:rsS:t:T:uz"
+#define COMMON_SHORT_OPTIONS "-bcdfgik:lmMno:rsS:t:T:uz"

 static struct option const long_options[] =
 {
@@ -358,6 +359,7 @@
   {"general-numeric-sort", no_argument, NULL, 'g'},
   {"ignore-nonprinting", no_argument, NULL, 'i'},
   {"key", required_argument, NULL, 'k'},
+  {"no-locale-sort", no_argument, NULL, 'l'},
   {"merge", no_argument, NULL, 'm'},
   {"month-sort", no_argument, NULL, 'M'},
   {"numeric-sort", no_argument, NULL, 'n'},
@@ -2421,6 +2423,13 @@
            files[nfiles++] = optarg;
          break;

+        case 'l':
+          hard_LC_COLLATE = 0;
+#if HAVE_NL_LANGINFO
+          hard_LC_TIME = 0;
+#endif
+          break;
+
        case 'b':
        case 'd':
        case 'f':


Ciao
-- 
http://www.dstoecker.de/ (PGP key available)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]