| 1115 | } |
| 1116 | |
| 1117 | static int fill(const char *path, int pathlen, int basename_offset, |
| 1118 | const struct attr_stack *stack, |
| 1119 | struct all_attrs_item *all_attrs, int rem) |
| 1120 | { |
| 1121 | for (; rem > 0 && stack; stack = stack->prev) { |
| 1122 | unsigned i; |
| 1123 | const char *base = stack->origin ? stack->origin : ""; |
| 1124 | |
| 1125 | for (i = stack->num_matches; 0 < rem && 0 < i; i--) { |
| 1126 | const struct match_attr *a = stack->attrs[i - 1]; |
| 1127 | if (a->is_macro) |
| 1128 | continue; |
| 1129 | if (path_matches(path, pathlen, basename_offset, |
| 1130 | &a->u.pat, base, stack->originlen)) |
| 1131 | rem = fill_one(all_attrs, a, rem); |
| 1132 | } |
| 1133 | } |
| 1134 | |
| 1135 | return rem; |
| 1136 | } |
| 1137 | |
| 1138 | /* |
| 1139 | * Marks the attributes which are macros based on the attribute stack. |
no test coverage detected