aboutsummaryrefslogtreecommitdiff
path: root/diffcore-order.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-26 18:44:15 -0800
committerJunio C Hamano <junkio@cox.net>2005-12-26 18:44:15 -0800
commite5f5219a4f1faf3b4e1816fad3a6296a1d39b878 (patch)
treee41c6fb839732b2fe45bd9416a22411ed3035a07 /diffcore-order.c
parent6ab58895cd951f6f5c96fa432afb122cfeb12746 (diff)
parent975b31dc6e12fba8f7b067ddbe32230995e05400 (diff)
downloadgit-1.0.5.tar.gz
git-1.0.5.tar.xz
GIT 1.0.5v1.0.5
Minor fixes. Starting from this one I won't be touching debian/ directory since the official maintainer seems to be reasonably quick to package up things. The packaging procedure used there seems to be quite different from what I have, so I'd like to avoid potential confusion and reduce work by the official maintainer and myself. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diffcore-order.c')
-rw-r--r--diffcore-order.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/diffcore-order.c b/diffcore-order.c
index b38122361..0bc2b22f8 100644
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -105,9 +105,13 @@ static int compare_pair_order(const void *a_, const void *b_)
void diffcore_order(const char *orderfile)
{
struct diff_queue_struct *q = &diff_queued_diff;
- struct pair_order *o = xmalloc(sizeof(*o) * q->nr);
+ struct pair_order *o;
int i;
+ if (!q->nr)
+ return;
+
+ o = xmalloc(sizeof(*o) * q->nr);
prepare_order(orderfile);
for (i = 0; i < q->nr; i++) {
o[i].pair = q->queue[i];