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

Function parse_config_key

config.c:3557–3591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3555}
3556
3557int parse_config_key(const char *var,
3558 const char *section,
3559 const char **subsection, size_t *subsection_len,
3560 const char **key)
3561{
3562 const char *dot;
3563
3564 /* Does it start with "section." ? */
3565 if (!skip_prefix(var, section, &var) || *var != '.')
3566 return -1;
3567
3568 /*
3569 * Find the key; we don't know yet if we have a subsection, but we must
3570 * parse backwards from the end, since the subsection may have dots in
3571 * it, too.
3572 */
3573 dot = strrchr(var, '.');
3574 *key = dot + 1;
3575
3576 /* Did we have a subsection at all? */
3577 if (dot == var) {
3578 if (subsection) {
3579 *subsection = NULL;
3580 *subsection_len = 0;
3581 }
3582 }
3583 else {
3584 if (!subsection)
3585 return -1;
3586 *subsection = var + 1;
3587 *subsection_len = dot - *subsection;
3588 }
3589
3590 return 0;
3591}
3592
3593const char *config_origin_type_name(enum config_origin_type type)
3594{

Callers 15

add_remote_urlFunction · 0.85
forbid_remote_urlFunction · 0.85
git_config_includeFunction · 0.85
git_unknown_cmd_configFunction · 0.85
tar_filter_configFunction · 0.85
reflog_expire_configFunction · 0.85
read_merge_configFunction · 0.85
handle_configFunction · 0.85
name_and_item_from_varFunction · 0.85
fsck_gitmodules_fnFunction · 0.85
userdiff_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected