[Top][All Lists]

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

Re: bash-4.3.33 regexp bug

From: Chet Ramey
Subject: Re: bash-4.3.33 regexp bug
Date: Fri, 06 Mar 2015 18:37:57 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 3/6/15 4:35 PM, Stephane Chazelas wrote:
> 2015-03-06 11:43:24 -0500, Chet Ramey:
>> On 3/5/15 12:36 PM, Greg Wooledge wrote:
>>> On Thu, Mar 05, 2015 at 05:26:00PM +0000, Stephane Chazelas wrote:
>>>> The bash manual only points to regex(3).
>>>> So it's down to your system's regex library (uses
>>>> regcomp(REG_EXTENDED)) which on recent GNU systems supports \s.
>>> I see.  So it's another nonportable feature like printf '%(%s)T'.
>> It's an imperfect world.  I'd rather not replace the system's regexp
>> library, just like I'd rather use the system's strftime(3) if it's
>> available.
> [...]
> BTW:
> $ ltrace -e regcomp bash -c 'bs="\\"; [[ a =~ ${bs}[\.s ]]'
> bash->regcomp(0x7fff4d48bef0, "\\[.s", 1)
> I think it should be
> bash->regcomp(0x7fff4d48bef0, "\\[\\.s", 1)

Thanks for the report.  I think you're right, and the code needs to handle
the absence of a closing bracket better.  This will be fixed for the next
release of bash.


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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