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

Function re_compile_pattern

compat/regex/regcomp.c:241–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239
240 Assumes the `allocated' (and perhaps `buffer') and `translate' fields
241 are set in BUFP on entry. */
242
243const char *
244re_compile_pattern (const char *pattern,
245 size_t length,
246 struct re_pattern_buffer *bufp)
247{
248 reg_errcode_t ret;
249
250 /* And GNU code determines whether or not to get register information
251 by passing null for the REGS argument to re_match, etc., not by
252 setting no_sub, unless RE_NO_SUB is set. */
253 bufp->no_sub = !!(re_syntax_options & RE_NO_SUB);
254
255 /* Match anchors at newline. */
256 bufp->newline_anchor = 1;
257
258 ret = re_compile_internal (bufp, pattern, length, re_syntax_options);
259
260 if (!ret)
261 return NULL;
262 return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
263}
264#ifdef _LIBC

Callers

nothing calls this directly

Calls 1

re_compile_internalFunction · 0.85

Tested by

no test coverage detected