Bug 249315
| Summary: | sort -R is not random in a non-C locale | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Jim Meyering <meyering> |
| Component: | coreutils | Assignee: | Ondrej Vasik <ovasik> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | rawhide | CC: | bakers, p |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2007-10-29 17:34:34 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 235704 | ||
Possible fix from Andreas Schwab...
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;
*** Bug 249421 has been marked as a duplicate of this bug. *** Change for i18n patch applied. Seems to be working correctly. Built as coreutils-6.9-10.fc9, closing RAWHIDE 3 months for an important bug with provided simple fix. Not great :( I hope this fix will be in F8 at least. Sorry, I got coreutils from Pete Graner 10 days ago, so I'm trying to get it into shape asap, but it will take some time... It will get to F8, but I don't know if it will happen before the official release - I want to have more troubles finished in one F8 commit/build and I don't know if I will finish it before release date. |
Description of problem: sort -R does not randomize its input in a non-C locale Version-Release number of selected component (if applicable): $ rpm -q coreutils coreutils-6.9-4.fc8 How reproducible: For example, the following should print differences, but does not: It produces no output. (export PATH=/bin:$PATH LC_ALL=fr_FR.utf8; \ diff <(seq 99|sort -R) <(seq 99|sort -R)) This example works fine with straight upstream code, so the problem is probably in the multibyte patch for sort.c. Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: