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

Function approxidate_digit

date.c:1351–1374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1349}
1350
1351static const char *approxidate_digit(const char *date, struct tm *tm, int *num,
1352 time_t now)
1353{
1354 char *end;
1355 timestamp_t number = parse_timestamp(date, &end, 10);
1356
1357 switch (*end) {
1358 case ':':
1359 case '.':
1360 case '/':
1361 case '-':
1362 if (isdigit(end[1])) {
1363 int match = match_multi_number(number, *end, date, end,
1364 tm, now);
1365 if (match)
1366 return date + match;
1367 }
1368 }
1369
1370 /* Accept zero-padding only for small numbers ("Dec 02", never "Dec 0002") */
1371 if (date[0] != '0' || end - date <= 2)
1372 *num = number;
1373 return end;
1374}
1375
1376static timestamp_t approxidate_str(const char *date,
1377 const struct timeval *tv,

Callers 1

approxidate_strFunction · 0.85

Calls 1

match_multi_numberFunction · 0.85

Tested by

no test coverage detected