bug-bash
[Top][All Lists]
Advanced

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

A question about bash change for efficiency speedups in multibyte locale


From: yangyajing
Subject: A question about bash change for efficiency speedups in multibyte locales
Date: Fri, 30 Mar 2018 09:57:35 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Hello,  I recently did lsb-test-core on ubuntu 16.04. There is a test
that can be successful in bash 4.1 but fails in bash 4.3.

The test comment is :  bash tp10.sh.

The content of tp10.sh is :   echo [[:xdigit:]] [[:hyphen:]].

And this test sets a multibyte locale that defines a charclass
containing ''hyphen''.

When I run the tp10.sh script with bash, I find that ''hyphen'' can be
recognized in bash4.1 but not in bash4.3.

By comparing the source code, I found that compared to bash4.1, there
are 2 more lines of code in bash4.3, which in the xstrmatch() function
in bash/lib/glob/smatch.c.
The two lines of code are as follows:


When I checked the change log at
https://tiswww.case.edu/php/chet/bash/CHANGES, I guess this change may
be for efficiency speedups.

So I want to confirm with you whether my guess is correct, and whether
this change ignores the fact that pattern does not have a multibyte
character but is defined in the charclass in multibyte locales.

Looking forward to your reply.





reply via email to

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