bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: grep 2.4.2 incorrect handling of '[x^]'


From: Keith Owens
Subject: Re: grep 2.4.2 incorrect handling of '[x^]'
Date: Tue, 31 Jul 2001 09:12:20 +1000

On Mon, 30 Jul 2001 14:27:19 -0700 (PDT), 
Paul Eggert <address@hidden> wrote:
>In the current POSIX standard, [a-c] matches any collating element in
>the collating seqence from 'a' through 'c' inclusive.  This is not the
>same as strcoll -- so the current code is indeed nonconforming.  Nor
>is it the same as the set of characters that [a-c] matches -- so the
>proposed patch is also nonconforming, even for unibyte locales.  (This
>is because a collating element can contain more than one character,
>e.g.  '[a-z]' can match 'ss' in a German locale.)
>
>Hence the proposed patch does not fix the whole problem.
>
>Also, I suspect that the proposed patch mishandles some cases,
>e.g. range expressions involving '[' itself.

That is exactly why I logged the problem in the first place.  '[x^]'
was misbehaving.  I searched Redhat's Bugzilla and found that somebody
had already reported that the patch broke commands like
  ps xa | grep '[^]]'ssh
which searches for ssh but excludes the grep command itself.  Because
that bug had already been reported against the RH patch, I did not add
another bug report.

One thing that is worrying, Redhat claim that this bug is fixed in grep
2.5e, where do they get version 2.5 from?  It is not an official
release number.  Also the latest RH grep I can find is still 2.4.2
which has their buggy patch.  I think this needs to be sorted out
between the grep maintainers and RH, it is time for me to bow out of
this thread.




reply via email to

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