| 56 | } |
| 57 | |
| 58 | static int match_order(const char *path) |
| 59 | { |
| 60 | int i; |
| 61 | static struct strbuf p = STRBUF_INIT; |
| 62 | |
| 63 | for (i = 0; i < order_cnt; i++) { |
| 64 | strbuf_reset(&p); |
| 65 | strbuf_addstr(&p, path); |
| 66 | while (p.buf[0]) { |
| 67 | char *cp; |
| 68 | if (!wildmatch(order[i], p.buf, 0)) |
| 69 | return i; |
| 70 | cp = strrchr(p.buf, '/'); |
| 71 | if (!cp) |
| 72 | break; |
| 73 | *cp = 0; |
| 74 | } |
| 75 | } |
| 76 | return order_cnt; |
| 77 | } |
| 78 | |
| 79 | static int compare_objs_order(const void *a_, const void *b_) |
| 80 | { |
no test coverage detected