Fix sorting by non-first field (#1003544)

This commit is contained in:
Ondrej Oprala 2014-01-06 11:49:28 +01:00
parent 31d3fdd040
commit 9b303ebcee
2 changed files with 9 additions and 6 deletions

View File

@ -3233,12 +3233,12 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c
+ diff = - NONZERO (lenb); + diff = - NONZERO (lenb);
+ else if (lenb == 0) + else if (lenb == 0)
+ diff = 1; + diff = 1;
+ else if (hard_LC_COLLATE && !folding)
+ {
+ diff = xmemcoll0 (texta, lena, textb, lenb);
+ }
+ else + else
+ { + diff = memcmp (texta, textb, MIN (lena + 1,lenb + 1));
+ diff = memcmp (texta, textb, MIN (lena,lenb));
+ if (!diff)
+ diff = xmemcoll (texta, lena, textb, lenb);
+ }
+ +
+ if (ignore || translate) + if (ignore || translate)
+ free (texta); + free (texta);

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils Name: coreutils
Version: 8.22 Version: 8.22
Release: 6%{?dist} Release: 7%{?dist}
License: GPLv3+ License: GPLv3+
Group: System Environment/Base Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/ Url: http://www.gnu.org/software/coreutils/
@ -372,6 +372,9 @@ fi
%{_sbindir}/chroot %{_sbindir}/chroot
%changelog %changelog
* Mon Jan 06 2014 Ondrej Oprala <ooprala@redhat.com> 8.22-7
- Fix sorting by non-first field (#1003544)
* Fri Jan 03 2014 Ondrej Vasik <ovasik@redhat.com> 8.22-6 * Fri Jan 03 2014 Ondrej Vasik <ovasik@redhat.com> 8.22-6
- do not modify SELinux contexts of existing parent - do not modify SELinux contexts of existing parent
directories when copying files (fix by P.Brady, #1045122) directories when copying files (fix by P.Brady, #1045122)