Re: possible wrong behaviour with patterns using a quoted ^ at the start of a bracket expression

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

 



On Wed, 2022-01-12 at 17:20 +0000, Harald van Dijk wrote:
> However, whether this is the correct approach is a matter of opinion:
> dash could alternatively choose to always take ^ as a literal and
> always 
> escape it before passing it on to fnmatch()

Well I personally think the best would to *always* take ^ literally,
whether quoted or not.

That would match the behaviour of bash and klibc sh, and also seems
more in the spirit of POSIX (which, while saying that an unquoted ^
produces undefined behaviour, also says that:
"( '!' ) shall replace the <circumflex> character ( '^' )""

... "replace", not complement.


Cheers,
Chris.



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux