diff options
Diffstat (limited to 'pathspec.c')
-rw-r--r-- | pathspec.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pathspec.c b/pathspec.c index c9e9b6c077..86f2b449b1 100644 --- a/pathspec.c +++ b/pathspec.c @@ -446,8 +446,7 @@ void parse_pathspec(struct pathspec *pathspec, if (pathspec->magic & PATHSPEC_MAXDEPTH) { if (flags & PATHSPEC_KEEP_ORDER) die("BUG: PATHSPEC_MAXDEPTH_VALID and PATHSPEC_KEEP_ORDER are incompatible"); - qsort(pathspec->items, pathspec->nr, - sizeof(struct pathspec_item), pathspec_item_cmp); + QSORT(pathspec->items, pathspec->nr, pathspec_item_cmp); } } @@ -485,11 +484,10 @@ void copy_pathspec(struct pathspec *dst, const struct pathspec *src) { *dst = *src; ALLOC_ARRAY(dst->items, dst->nr); - memcpy(dst->items, src->items, - sizeof(struct pathspec_item) * dst->nr); + COPY_ARRAY(dst->items, src->items, dst->nr); } -void free_pathspec(struct pathspec *pathspec) +void clear_pathspec(struct pathspec *pathspec) { free(pathspec->items); pathspec->items = NULL; |