Commit Diff


commit - 30f6c0c64b5c08d79e22cc2c0bd1f1340288a7f5
commit + f4ff4f7a253c1eb85a549d1d64b00d30b8c4ccd3
blob - 1c9b6d17294abf78edffde84b7937856f2620bb1
blob + 42d4d5b39ef5a587321d90c1b95ef4f616e882b3
--- lib/diff_output_edscript.c
+++ lib/diff_output_edscript.c
@@ -45,8 +45,10 @@ output_edscript_chunk(struct diff_output_info *outinfo
 		left_start = 0;
 	else if (left_len == 0 && cc->left.start > 0)
 		left_start = cc->left.start;
-	else
+	else if (cc->left.end > 0)
 		left_start = cc->left.start + 1;
+	else
+		left_start = cc->left.start;
 
 	right_len = cc->right.end - cc->right.start;
 	if (right_len < 0)
@@ -55,8 +57,10 @@ output_edscript_chunk(struct diff_output_info *outinfo
 		right_start = 0;
 	else if (right_len == 0 && cc->right.start > 0)
 		right_start = cc->right.start;
-	else
+	else if (cc->right.end > 0)
 		right_start = cc->right.start + 1;
+	else
+		right_start = cc->right.start;
 
 	if (left_len == 0) {
 		/* addition */