Re: [PATCH V2 4/5] git-grep: Learn PCRE

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

 



2011/5/5 MichaÅ Kiedrowicz <michal.kiedrowicz@xxxxxxxxx>:
> +#ifdef NO_LIBPCRE
> +static void compile_pcre_regexp(struct grep_pat *p, struct grep_opt *opt)
> +{
> + Â Â Â die("cannot use Perl-compatible regexes when libpcre is not compiled in");
> +}

Looks like these two functions below can be just left empty, because you will
exit when calling compile_pcre_regexp in compile_regexp.

> +static int pcrematch(struct grep_pat *p, char *line, char *eol,
> + Â Â Â Â Â Â Â regmatch_t *match, int eflags)
> +{
> + Â Â Â die("cannot use Perl-compatible regexes when libpcre is not compiled in");
> +}
> +
> +static void free_pcre_regexp(struct grep_pat *p)
> +{
> + Â Â Â die("cannot use Perl-compatible regexes when libpcre is not compiled in");
> +}
> +

These will be never called, because...

> @@ -70,6 +135,11 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
> Â Â Â Âif (p->fixed)
> Â Â Â Â Â Â Â Âreturn;
>
> + Â Â Â if (opt->pcre) {
> + Â Â Â Â Â Â Â compile_pcre_regexp(p, opt);
> + Â Â Â Â Â Â Â return;
> + Â Â Â }

... you die here, if PCRE not available.
--
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]