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

Function match_placeholder_arg_value

pretty.c:1195–1224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1193}
1194
1195static int match_placeholder_arg_value(const char *to_parse, const char *candidate,
1196 const char **end, const char **valuestart,
1197 size_t *valuelen)
1198{
1199 const char *p;
1200
1201 if (!(skip_prefix(to_parse, candidate, &p)))
1202 return 0;
1203 if (valuestart) {
1204 if (*p == '=') {
1205 *valuestart = p + 1;
1206 *valuelen = strcspn(*valuestart, ",)");
1207 p = *valuestart + *valuelen;
1208 } else {
1209 if (*p != ',' && *p != ')')
1210 return 0;
1211 *valuestart = NULL;
1212 *valuelen = 0;
1213 }
1214 }
1215 if (*p == ',') {
1216 *end = p + 1;
1217 return 1;
1218 }
1219 if (*p == ')') {
1220 *end = p;
1221 return 1;
1222 }
1223 return 0;
1224}
1225
1226static int match_placeholder_bool_arg(const char *to_parse, const char *candidate,
1227 const char **end, int *val)

Callers 4

parse_describe_argsFunction · 0.85
parse_decoration_optionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected