bug-coreutils
[Top][All Lists]
Advanced

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

Re: sort "b" option in pos2 has strange effect


From: Jim Meyering
Subject: Re: sort "b" option in pos2 has strange effect
Date: Fri, 27 Feb 2009 15:00:23 +0100

Pádraig Brady wrote:
> I also noticed that freeBSD/Mac OS X use coreutils sort
> so they have the same issue.
> Also the i18n patch in fedora 8 at least seems
> to be varying one of the problems somewhat:
>
> upstream buggy coreutils:
>   $ printf "a  y\na z\n" | sort -k1,1b #buggy
>   a z
>   a  y
>   $ printf "a  y\na z\n" | sort -k1b,1 #ok
>   a  y
>   a z
>
> fedora 8:
>   $ printf "a  y\na z\n" | sort -k1,1b #ok
>   a  y
>   a z
>   $ printf "a  y\na z\n" | sort -k1b,1 #buggy
>   a z
>   a  y
>
> So I'll add the attached test I think to check for that.

Good catch.  Thanks.

...
> +# When ignoring leading blanks for start position, ensure blanks from
> +# next field are not included in the sort. I.E. order should not change here.
> +# This was noticed as an issue on fedora 8 (only in multibyte locales).
> +["18g", '-k1b,1', {IN=>"a  y\na z\n"}, {OUT=>"a  y\na z\n"}, {ENV => 
> "LC_ALL=$locale"}],

Please split that longer-than-80 line onto two, e.g.:

["18g", '-k1b,1', {IN=>"a  y\na z\n"}, {OUT=>"a  y\na z\n"},
 {ENV => "LC_ALL=$locale"}],




reply via email to

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