| 446 | } |
| 447 | |
| 448 | static int parse_range(const char **p, |
| 449 | unsigned long *offset, unsigned long *count) |
| 450 | { |
| 451 | char *pend; |
| 452 | |
| 453 | *offset = strtoul(*p, &pend, 10); |
| 454 | if (pend == *p) |
| 455 | return -1; |
| 456 | if (*pend != ',') { |
| 457 | *count = 1; |
| 458 | *p = pend; |
| 459 | return 0; |
| 460 | } |
| 461 | *count = strtoul(pend + 1, (char **)p, 10); |
| 462 | return *p == pend + 1 ? -1 : 0; |
| 463 | } |
| 464 | |
| 465 | static int parse_hunk_header(struct add_p_state *s, struct hunk *hunk) |
| 466 | { |