[PATCH 2/4] xdl_merge(): do return number of conflicts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If no error occurred during merge, xdl_merge() is supposed to return
the number of conflicts.

Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>

---
 xdiff/xmerge.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xdiff/xmerge.c b/xdiff/xmerge.c
index 7b85aa5..6b6fbb8 100644
--- a/xdiff/xmerge.c
+++ b/xdiff/xmerge.c
@@ -384,6 +384,7 @@ int xdl_merge(mmfile_t *orig, mmfile_t *
 		xpparam_t const *xpp, int level, mmbuffer_t *result) {
 	xdchange_t *xscr1, *xscr2;
 	xdfenv_t xe1, xe2;
+	int ret = 0;
 
 	result->ptr = NULL;
 	result->size = 0;
@@ -413,9 +414,9 @@ int xdl_merge(mmfile_t *orig, mmfile_t *
 			result->ptr = xdl_malloc(mf1->size);
 			memcpy(result->ptr, mf1->ptr, mf1->size);
 			result->size = mf1->size;
-		} else if (xdl_do_merge(&xe1, xscr1, name1,
+		} else if ((ret = xdl_do_merge(&xe1, xscr1, name1,
 					&xe2, xscr2, name2,
-					level, xpp, result) < 0) {
+					level, xpp, result)) < 0) {
 			xdl_free_script(xscr1);
 			xdl_free_script(xscr2);
 			xdl_free_env(&xe1);
@@ -428,6 +429,6 @@ int xdl_merge(mmfile_t *orig, mmfile_t *
 	xdl_free_env(&xe1);
 	xdl_free_env(&xe2);
 
-	return 0;
+	return ret;
 }
 
-- 
1.4.4.g5aac-dirty

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]