grep/icase: avoid kwsset on literal non-ascii strings
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 25 Jun 2016 05:22:30 +0000 (07:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Jun 2016 14:31:35 +0000 (07:31 -0700)
When we detect the pattern is just a literal string, we avoid heavy
regex engine and use fast substring search implemented in kwsset.c.
But kws uses git-ctype which is locale-independent so it does not know
how to fold case properly outside ascii range. Let regcomp or pcre
take care of this case instead. Slower, but accurate.

Noticed-by: Plamen Totev <plamen.totev@abv.bg>
Helped-by: René Scharfe <l.s.r@web.de>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found