| 36 | }; |
| 37 | |
| 38 | static void find_better_matching_suffix(const char *tagname, const char *suffix, |
| 39 | int suffix_len, int start, int conf_pos, |
| 40 | struct suffix_match *match) |
| 41 | { |
| 42 | /* |
| 43 | * A better match either starts earlier or starts at the same offset |
| 44 | * but is longer. |
| 45 | */ |
| 46 | int end = match->len < suffix_len ? match->start : match->start-1; |
| 47 | int i; |
| 48 | for (i = start; i <= end; i++) |
| 49 | if (starts_with(tagname + i, suffix)) { |
| 50 | match->conf_pos = conf_pos; |
| 51 | match->start = i; |
| 52 | match->len = suffix_len; |
| 53 | break; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /* |
| 58 | * off is the offset of the first different character in the two strings |
no test coverage detected