From 1aed8c3d4d59545fc96779fafae82e9ccbd841fa Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Thu, 17 Mar 2016 23:44:53 -0700 Subject: [PATCH] Fix manifest subtraction logic In subtract_manifests(), if the two files under consideration have the same filename but should not be subtracted, a file is skipped in the m2 manifest because there is no "continue" statement at the end of the first "if" block. This results in potentially many files not getting subtracted when they ought to be. To clarify the logic, avoid using "continue", since it is not needed. Convert to using one "if" block instead. Signed-off-by: Patrick McCarty --- src/manifest.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 1b893bc..a274c3b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -546,15 +546,12 @@ void subtract_manifests(struct manifest *m1, struct manifest *m2) if (file1->is_deleted == file2->is_deleted && file1->is_file == file2->is_file) { m1->files = g_list_delete_link(m1->files, todel); m1->count--; - continue; } - } - - if (ret < 0) { + } else if (ret < 0) { list1 = g_list_next(list1); - continue; + } else { + list2 = g_list_next(list2); } - list2 = g_list_next(list2); } }