commit - 12c5bde7b2b0371050910b2446b9aaad5fc44573
commit + cbf93b702bb81f143354b53125c64579a5040fcc
blob - d3fb08b4f85c7df22caa8b63d284698ef9a26235
blob + f48c869ab05318ba318a42e11631e120cedb7cb6
--- lib/diff_internal.h
+++ lib/diff_internal.h
struct diff_chunk_context;
bool
+diff_chunk_context_empty(const struct diff_chunk_context *cc);
+
+bool
diff_chunk_contexts_touch(const struct diff_chunk_context *cc,
const struct diff_chunk_context *other);
blob - 38053a9163403e9b1871f8d864aec3d3d8460956
blob + 234534311b03e23374b96bf69a64d6f670196b87
--- lib/diff_output_edscript.c
+++ lib/diff_output_edscript.c
if (t != CHUNK_MINUS && t != CHUNK_PLUS)
continue;
- if (diff_range_empty(&cc.chunk)) {
+ if (diff_chunk_context_empty(&cc)) {
/* Note down the start point, any number of subsequent
* chunks may be joined up to this chunk by being
* directly adjacent. */
cc = next;
}
- if (!diff_range_empty(&cc.chunk))
+ if (!diff_chunk_context_empty(&cc))
return output_edscript_chunk(outinfo, dest, info, result, &cc);
return DIFF_RC_OK;
}
blob - 1ca6f80e8c29baa9241a9768b18d41e97cf079be
blob + 1d7534ed300500cb5a0da2b4dbcad1d6b448a7cf
--- lib/diff_output_unidiff.c
+++ lib/diff_output_unidiff.c
#include "diff_internal.h"
#include "diff_debug.h"
-static bool
-chunk_context_empty(const struct diff_chunk_context *cc)
+bool
+diff_chunk_context_empty(const struct diff_chunk_context *cc)
{
return diff_range_empty(&cc->chunk);
}
if (t != CHUNK_MINUS && t != CHUNK_PLUS)
continue;
- if (chunk_context_empty(&cc)) {
+ if (diff_chunk_context_empty(&cc)) {
/* These are the first lines being printed.
* Note down the start point, any number of subsequent
* chunks may be joined up to this unidiff chunk by
cc.left.start, cc.left.end, cc.right.start, cc.right.end);
}
- if (!chunk_context_empty(&cc))
+ if (!diff_chunk_context_empty(&cc))
output_unidiff_chunk(outinfo, dest, state, info, result, &cc);
diff_output_unidiff_state_free(state);
return DIFF_RC_OK;