bug-coreutils
[Top][All Lists]
Advanced

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

Re: sort --random-sort (-R) is not random in non-C locale (w/i18n patch)


From: Andreas Schwab
Subject: Re: sort --random-sort (-R) is not random in non-C locale (w/i18n patch)
Date: Tue, 24 Jul 2007 22:26:42 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux)

Jim Meyering <address@hidden> writes:

> FYI, I've filed this bug report:
>
>   http://bugzilla.redhat.com/249315
>
> If someone fixes it before I do (e.g. for another distro),
> please let me know.

If they use the same i18n patch, then this should work (will appear soon
in openSUSE Factory):

--- src/sort.c
+++ src/sort.c
@@ -2341,7 +2341,10 @@ keycompare_mb (const struct line *a, con
       size_t lenb = limb <= textb ? 0 : limb - textb;
 
       /* Actually compare the fields. */
-      if (key->numeric | key->general_numeric)
+
+      if (key->random)
+       diff = compare_random (texta, lena, textb, lenb);
+      else if (key->numeric | key->general_numeric)
        {
          char savea = *lima, saveb = *limb;
 

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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