From 9028469456c1ee6d18976a99151286d9084f9ebc Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Thu, 17 Feb 2005 17:03:50 +0000 Subject: [PATCH] Fix a nasty runlist merge bug when merging two holes. (Anton) (Logical change 1.677) --- libntfs/runlist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libntfs/runlist.c b/libntfs/runlist.c index 3e7b1763..722505da 100644 --- a/libntfs/runlist.c +++ b/libntfs/runlist.c @@ -111,8 +111,11 @@ static __inline__ BOOL ntfs_rl_are_mergeable(runlist_element *dst, return FALSE; } - if ((dst->lcn < 0) || (src->lcn < 0)) /* Are we merging holes? */ + if ((dst->lcn < 0) || (src->lcn < 0)) { /* Are we merging holes? */ + if (dst->lcn == LCN_HOLE && src->lcn == LCN_HOLE) + return TRUE; return FALSE; + } if ((dst->lcn + dst->length) != src->lcn) /* Are the runs contiguous? */ return FALSE; if ((dst->vcn + dst->length) != src->vcn) /* Are the runs misaligned? */