On Wed, Jul 8, 2015 at 5:38 PM, Nguyễn Thái Ngọc Duy <pclo...@gmail.com> wrote:
> diff --git a/grep.c b/grep.c
> index 8fce54f..c79aa70 100644
> --- a/grep.c
> +++ b/grep.c
> @@ -324,11 +324,13 @@ static void compile_pcre_regexp(struct grep_pat *p, 
> const struct grep_opt *opt)
>         int erroffset;
>         int options = PCRE_MULTILINE;
>
> -       if (opt->ignore_case)
> +       if (opt->ignore_case) {
> +               p->pcre_tables = pcre_maketables();

This affects ascii-only case too because I didn't use has_non_ascii()
here. I guess it's ok because the doc says there are default tables
anyway. But I'm not really familiar with pcre... If they have
optimizations for when the last argument of pcre_compile() is NULL, we
have a regression.

>                 options |= PCRE_CASELESS;
> +       }
>
>         p->pcre_regexp = pcre_compile(p->pattern, options, &error, &erroffset,
> -                       NULL);
> +                                     p->pcre_tables);
>         if (!p->pcre_regexp)
>                 compile_regexp_failed(p, error);
>
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to