Re: [PATCH] t9129: fix UTF-8 locale detection

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

 



Le mardi 18 mai 2010 à 10:45 -0700, Linus Torvalds a écrit :
> 
> On Tue, 18 May 2010, Yann Droneaud wrote:
> >  
> > -if locale -a |grep -q en_US.utf8; then
> > +if locale -a |grep -qE '^en_US\.(utf|UTF)-?8$'; then
> 
> While -E is POSIX, I suspect that it's not universal. iirc, you still have 
> some really crap fileutils tools coming with Solaris, for example. 
> 

You're right, Solaris's own grep doesn't known about -E nor -e.

And it even doesn't know about -q : 

 $ grep -q                                                     
 grep: illegal option -- q
 Usage: grep -hblcnsviw pattern file . . .

So the whole test won't work for older Solaris.

Solaris don't support grep -e, but has the non POSIX egrep instead
(which doesn't support -q too).

[...]

> I'm also not entirely sure you want to make that pattern stricter - the 
> whole problem with the old pattern was that it was too exact, so why add 
> the beginning/end requirement?
> 

Just to be sure it doesn't match "garbage". 
Initial regexp was using a straight '.' operator, so while fixing it, I
thought it would be better to achieve "perfect match".

Regards.

-- 
Yann Droneaud

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]