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

Re: Bug#203820: Incorrect expanding [] glob



At Sat, 2 Aug 2003 03:23:35 +0200,
Micha-B� Politowski wrote:
> On Sat,  2 Aug 2003 00:44:16 +0200, Artur R. Czechowski wrote:
> > When LC_COLLATE is set to pl_PL [] glob does not work correctly:
>
> > arturcz@zlom:/tmp/bash-test$ echo $LC_COLLATE
> > pl_PL
> > arturcz@zlom:/tmp/bash-test$ touch a b C c D e F G h
> > arturcz@zlom:/tmp/bash-test$ echo [A-Z]
> > b c C D e F G h
> > arturcz@zlom:/tmp/bash-test$ export LC_COLLATE=C
> > arturcz@zlom:/tmp/bash-test$ echo [A-Z]
> > C D F G

You should set LC_CTYPE.  Only setting LC_COLLATE does not work
correctly, because collation elements are defined in LC_CTYPE
category.

bash-2.05b$ env LC_COLLATE=pl_PL LC_CTYPE=pl_PL echo [A-Z]
C D F G
bash-2.05b$ env LC_COLLATE=pl_PL LC_CTYPE=pl_PL echo [a-Z]
[a-Z]

So this bug should be closed.  Could you close this bug?

> You didn't specify what would you consider "working correctly"
> so I assume you expect LC_COLLATE not to affect what a range expression
> matches.
> SUSv3 says:
>     7. In the POSIX locale, a range expression represents the set of collating
>        elements that fall between two elements in the collation sequence, inclusive.
>        In other locales, a range expression has unspecified behavior: strictly
>        conforming applications shall not rely on whether the range expression is
>        valid, or on the set of collating elements matched.
> 
> I would say matching according to the specified collating order _is_ reasonable.

Well, this is partially correct, but it's not reasonable.  As you
said, POSIX does not define each locales except for C locale, but
there are some regional standard.  If you set LC_COLLATE and LC_CTYPE
correctly, and you see this kind of behavior and you think it's not
right on this locale, then we can say this is bug.

Regards,
-- gotom



Reply to: