| 338 | } |
| 339 | |
| 340 | static int find_same_and_apply_arg(struct list_head *head, |
| 341 | struct arg_item *arg_tok) |
| 342 | { |
| 343 | struct list_head *pos; |
| 344 | struct trailer_item *in_tok; |
| 345 | struct trailer_item *on_tok; |
| 346 | |
| 347 | enum trailer_where where = arg_tok->conf.where; |
| 348 | int middle = (where == WHERE_AFTER) || (where == WHERE_BEFORE); |
| 349 | int backwards = after_or_end(where); |
| 350 | struct trailer_item *start_tok; |
| 351 | |
| 352 | if (list_empty(head)) |
| 353 | return 0; |
| 354 | |
| 355 | start_tok = list_entry(backwards ? head->prev : head->next, |
| 356 | struct trailer_item, |
| 357 | list); |
| 358 | |
| 359 | list_for_each_dir(pos, head, backwards) { |
| 360 | in_tok = list_entry(pos, struct trailer_item, list); |
| 361 | if (!same_token(in_tok, arg_tok)) |
| 362 | continue; |
| 363 | on_tok = middle ? in_tok : start_tok; |
| 364 | apply_arg_if_exists(in_tok, arg_tok, on_tok, head); |
| 365 | return 1; |
| 366 | } |
| 367 | return 0; |
| 368 | } |
| 369 | |
| 370 | void process_trailers_lists(struct list_head *head, |
| 371 | struct list_head *arg_head) |
no test coverage detected