[Top][All Lists]

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

complete-into-braces incorrect when using localized sorting

From: Torsten Nahm
Subject: complete-into-braces incorrect when using localized sorting
Date: Fri, 14 Mar 2008 21:16:40 +0100
User-agent: Thunderbird (X11/20080227)

Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib -g -O2 -Wall uname output: Linux stream 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu

Bash Version: 3.2
Patch Level: 25
Release Status: release

Completion into braces does not work correctly in some instances where filenames start with the same string but with different capitalizations thereof and localized sorting is enabled

    Use a localized bash and go into an empty directory.
    create the files "ya, xYb and xyc
    Type M-{
    This expands to xy{a,b,c}, with the y incorrectly lowercase for xYb
    Set LC_ALL=C
    Type M-{
    The expansion is now correct: x{Yb,y{a,c}}

A quick look at the code suggests that gcd determination in really_munge_braces depends on the array being sorted in ascending (byte) order, as supplied if the locale is set to C. If the sorting is localized, lowercase and uppercase are usually treated equally, and the gcd determination gets confused. A fix would be to use byte value sorting for complete-into-braces

reply via email to

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