| 1349 | } |
| 1350 | |
| 1351 | static 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 | |
| 1376 | static timestamp_t approxidate_str(const char *date, |
| 1377 | const struct timeval *tv, |
no test coverage detected