From 46a2c860622959af539354c1a336222a32c4d83a Mon Sep 17 00:00:00 2001 From: Ondrej Oprala Date: Jan 06 2014 10:52:48 +0000 Subject: Fix sorting by non-first field (#1003544) --- diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch index c68ad94..ecebadc 100644 --- a/coreutils-i18n.patch +++ b/coreutils-i18n.patch @@ -3251,12 +3251,12 @@ diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c + diff = - NONZERO (lenb); + else if (lenb == 0) + diff = 1; ++ else if (hard_LC_COLLATE && !folding) ++ { ++ diff = xmemcoll0 (texta, lena, textb, lenb); ++ } + else -+ { -+ diff = memcmp (texta, textb, MIN (lena,lenb)); -+ if (!diff) -+ diff = xmemcoll (texta, lena, textb, lenb); -+ } ++ diff = memcmp (texta, textb, MIN (lena + 1,lenb + 1)); + + if (ignore || translate) + free (texta); diff --git a/coreutils.spec b/coreutils.spec index 26872e0..3c0cf57 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ Summary: A set of basic GNU tools commonly used in shell scripts Name: coreutils Version: 8.21 -Release: 19%{?dist} +Release: 20%{?dist} License: GPLv3+ Group: System Environment/Base Url: http://www.gnu.org/software/coreutils/ @@ -375,6 +375,9 @@ fi %{_sbindir}/chroot %changelog +* Mon Jan 06 2014 Ondrej Oprala 8.21-20 +- fix sorting by non-first field (#1003544) + * Fri Jan 03 2014 Ondrej Oprala 8.21-19 - reverted an old change and constricted it's condition