"start[,count]" after a '-' or '+' in a hunk header. No count means 1. */
| 83 | |
| 84 | /* "start[,count]" after a '-' or '+' in a hunk header. No count means 1. */ |
| 85 | static bool df_range(const char **p, const char *end, char sign, int *start, int *count) { |
| 86 | if (*p >= end || **p != sign) { |
| 87 | return false; |
| 88 | } |
| 89 | (*p)++; |
| 90 | if (!df_number(p, end, start)) { |
| 91 | return false; |
| 92 | } |
| 93 | *count = 1; |
| 94 | if (*p < end && **p == ',') { |
| 95 | (*p)++; |
| 96 | return df_number(p, end, count); |
| 97 | } |
| 98 | return true; |
| 99 | } |
| 100 | |
| 101 | /* "@@ -a[,b] +c[,d] @@": the old and new line ranges. */ |
| 102 | static bool df_hunk_header(const df_line_t *line, int *old_count, int *new_start, int *new_count) { |
no test coverage detected