MCPcopy Index your code
hub / github.com/git/git / find_name_gnu

Function find_name_gnu

apply.c:464–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464static char *find_name_gnu(struct strbuf *root,
465 const char *line,
466 int p_value)
467{
468 struct strbuf name = STRBUF_INIT;
469 char *cp;
470
471 /*
472 * Proposed "new-style" GNU patch/diff format; see
473 * https://lore.kernel.org/git/7vll0wvb2a.fsf@assigned-by-dhcp.cox.net/
474 */
475 if (unquote_c_style(&name, line, NULL)) {
476 strbuf_release(&name);
477 return NULL;
478 }
479
480 for (cp = name.buf; p_value; p_value--) {
481 cp = strchr(cp, '/');
482 if (!cp) {
483 strbuf_release(&name);
484 return NULL;
485 }
486 cp++;
487 }
488
489 strbuf_remove(&name, 0, cp - name.buf);
490 if (root->len)
491 strbuf_insert(&name, 0, root->buf, root->len);
492 return squash_slash(strbuf_detach(&name, NULL));
493}
494
495static size_t sane_tz_len(const char *line, size_t len)
496{

Callers 2

find_nameFunction · 0.85
find_name_traditionalFunction · 0.85

Calls 6

unquote_c_styleFunction · 0.85
strbuf_releaseFunction · 0.85
strbuf_removeFunction · 0.85
strbuf_insertFunction · 0.85
squash_slashFunction · 0.85
strbuf_detachFunction · 0.85

Tested by

no test coverage detected