commit - 89ec5a10f64f31161f0b5ee5dedb2058f759ffff
commit + 4019a9fe35112f53e459db3f3b76a03bccaeed1c
blob - c9195aeb30ba2412dc487ede2615e9ff7347da66
blob + c1bb9102eea8d902ba0d018a47e4ba4ae1a2f631
--- diff_output.c
+++ diff_output.c
{
int i;
- if (!result)
- return DIFF_RC_EINVAL;
- if (result->rc != DIFF_RC_OK)
- return result->rc;
-
diff_output_info(dest, info);
for (i = 0; i < result->chunks.len; i++) {
left_len = left_len < 0 ? strlen(left) : left_len;
right_len = right_len < 0 ? strlen(right) : right_len;
result = diff_main(diff_config, left, left_len, right, right_len);
+ if (!result)
+ return DIFF_RC_EINVAL;
+ if (result->rc != DIFF_RC_OK)
+ return result->rc;
rc = diff_output_plain(dest, info, result);
diff_result_free(result);
return rc;
bool info_printed = false;
int i;
- if (!result)
- return DIFF_RC_EINVAL;
- if (result->rc != DIFF_RC_OK)
- return result->rc;
-
for (i = 0; i < result->chunks.len; i++) {
struct diff_chunk *c = &result->chunks.head[i];
enum chunk_type t = chunk_type(c);
left_len = left_len < 0 ? strlen(left) : left_len;
right_len = right_len < 0 ? strlen(right) : right_len;
result = diff_main(diff_config, left, left_len, right, right_len);
+ if (!result)
+ return DIFF_RC_EINVAL;
+ if (result->rc != DIFF_RC_OK)
+ return result->rc;
rc = diff_output_unidiff(dest, info, result, context_lines);
diff_result_free(result);
return rc;