MCPcopy Create free account
hub / github.com/git/git / compile_fixed_regexp

Function compile_fixed_regexp

grep.c:473–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473static void compile_fixed_regexp(struct grep_pat *p, struct grep_opt *opt)
474{
475 struct strbuf sb = STRBUF_INIT;
476 int err;
477 int regflags = 0;
478
479 basic_regex_quote_buf(&sb, p->pattern);
480 if (opt->ignore_case)
481 regflags |= REG_ICASE;
482 err = regcomp(&p->regexp, sb.buf, regflags);
483 strbuf_release(&sb);
484 if (err) {
485 char errbuf[1024];
486 regerror(err, &p->regexp, errbuf, sizeof(errbuf));
487 compile_regexp_failed(p, errbuf);
488 }
489}
490#endif /* !USE_LIBPCRE2 */
491
492static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)

Callers 1

compile_regexpFunction · 0.85

Calls 5

basic_regex_quote_bufFunction · 0.85
regcompFunction · 0.85
strbuf_releaseFunction · 0.85
regerrorFunction · 0.85
compile_regexp_failedFunction · 0.85

Tested by

no test coverage detected