commit - e1595dc1c75393361878450cc70fcefee131810a
commit + 9f5da0913af47a525ab2a2422c7911cdb08866d0
blob - 5e816ae10b5948c0aeacd27365a91f3147b96baf
blob + fa9dc982956eab298f65b4b9ffca114a46b50b76
--- include/diff_main.h
+++ include/diff_main.h
struct diff_data *left,
struct diff_data *right);
void diff_result_free(struct diff_result *result);
+int diff_result_contains_printable_chunks(struct diff_result *result);
blob - c531ad29bc45c650dd4e3dbc4773479aafd7676b
blob + 325830b65763ecd28f365b69cfc7091b6445971f
--- lib/diff_main.c
+++ lib/diff_main.c
return;
ARRAYLIST_FREE(result->chunks);
free(result);
+}
+
+int
+diff_result_contains_printable_chunks(struct diff_result *result)
+{
+ struct diff_chunk *c;
+ enum diff_chunk_type t;
+
+ for (int i = 0; i < result->chunks.len; i++) {
+ c = &result->chunks.head[i];
+ t = diff_chunk_type(c);
+ if (t == CHUNK_MINUS || t == CHUNK_PLUS)
+ return 1;
+ }
+
+ return 0;
}