Description of problem: The --version-sort (-V) option of sort(1) is not honored in multibyte locales. Version-Release number of selected component (if applicable): coreutils-7.2-1.fc11 How reproducible: 100% Steps to Reproduce: 1. { echo "narf.9"; echo "narf.10"; } | sort --version-sort Actual results (just a lexical sort): narf.10 narf.9 Expected results (sorted ala 'ls -v'): narf.9 narf.10 Additional info: Detection of key->version was apparently inadvertently omitted from keycompare_mb() (it is in keycompare_uni() ). Fix is simply to clone it from the latter: diff -urp coreutils-7.2.orig/src/sort.c coreutils-7.2/src/sort.c --- coreutils-7.2.orig/src/sort.c 2009-07-01 23:24:30.000000000 -0700 +++ coreutils-7.2/src/sort.c 2009-07-02 01:16:45.000000000 -0700 @@ -2508,6 +2508,8 @@ keycompare_mb (const struct line *a, con (texta, textb)); *lima = savea, *limb = saveb; } + else if (key->version) + diff = compare_version (texta, lena, textb, lenb); else if (key->month) diff = getmonth (texta, lena) - getmonth (textb, lenb); else
Thank you for the report and the patch! I can confirm the bug and that it is fixed by the patch.
Thanks for report (and patch). Fixed in Rawhide and built as coreutils-7.4-3.fc12, there are already few bugs fixed in rawhide, so will do cumulative F-11 (and maybe F-10) coreutils update soon. Damned multibyte patch, I'm quite sure there are more such things, probably have to check it.
coreutils-7.2-2.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/coreutils-7.2-2.fc11
coreutils-7.2-2.fc11 has been pushed to the Fedora 11 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update coreutils'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-7643
coreutils-7.2-2.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.