bugGNU Core Utilities - Bugs: bug #27373, sort -h performs incorrectly if in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #27373: sort -h performs incorrectly if in utf8 locale.

Submitted by:  None
Submitted on:  Wed 02 Sep 2009 07:12:06 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sat 05 Sep 2009 02:57:51 PM UTC, comment #3:

closed at reporter's request (was due to a bad distro patch)

Jim Meyering <meyering>
Project Administrator
Sat 05 Sep 2009 10:24:20 AM UTC, comment #2:

I've traced this to a dodgy distro patch. Feel free to close the ticket. Sorry to bother you.

B <bladud>
Wed 02 Sep 2009 09:43:57 PM UTC, comment #1:

I can't reproduce this or see anything wrong with the code.

All 720 of my locales work fine:

$ for LANG in $(locale -a); do printf "K\nE\nM\nZ\n" | ./sort -h | tr -d '\n'; echo; done | uniq -c
720 KMEZ

Can you give your libc version?
Could you add a printf() to the find_unit_order() function in sort.c to see if it's called?

thanks.

Pádraig Brady <pixelbeat>
Project Administrator
Wed 02 Sep 2009 07:12:06 PM UTC, original submission:

Sample shell session:
% echo $LC_ALL

% echo $LC_COLLATE
C
% echo $LANG
en_GB.utf8
% printf "1Mi\n1M" | sort -h
1M
1Mi
% export LANG=en_GB
% printf "1Mi\n1M" | sort -h
sort: both SI and IEC prefixes present on units

The relevant lines in my locale.gen are:
en_GB.UTF-8 UTF-8
en_GB ISO-8859-1

However, this appears to occurs for any utf8 locale. Coreutils 7.5. Other tests fail in a similar manner, eg:

% export LANG=en_GB.utf8
% printf "K\nE\nM\nZ\n" | ./sort -h
E
K
M
Z
% export LANG="en_GB"
% printf "K\nE\nM\nZ\n" | ./sort -h
K
M
E
Z

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by meyering (Posted a comment)
  • -unavailable- added by bladud (Posted a comment)
  • -unavailable- added by pixelbeat (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 05 Sep 2009 02:57:51 PM UTCmeyeringStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1