This file-struct sorting routine makes sure that any identical names in * the file list stay in the same order as they were in the original list. * This is particularly vital in inc_recurse mode where we expect a sort * on the flist to match the exact order of a sort on the dir_flist. */
| 1781 | * This is particularly vital in inc_recurse mode where we expect a sort |
| 1782 | * on the flist to match the exact order of a sort on the dir_flist. */ |
| 1783 | static void fsort(struct file_struct **fp, size_t num) |
| 1784 | { |
| 1785 | if (num <= 1) |
| 1786 | return; |
| 1787 | |
| 1788 | if (use_qsort) |
| 1789 | qsort(fp, num, PTR_SIZE, file_compare); |
| 1790 | else { |
| 1791 | struct file_struct **tmp = new_array(struct file_struct *, (num+1) / 2); |
| 1792 | fsort_tmp(fp, num, tmp); |
| 1793 | free(tmp); |
| 1794 | } |
| 1795 | } |
| 1796 | |
| 1797 | /* We take an entire set of sibling dirs from the sorted flist and link them |
| 1798 | * into the tree, setting the appropriate parent/child/sibling pointers. */ |
no test coverage detected