commit - 945524ed4b6d392d757bcb026f93717922e64a88
commit + 05b5f01fe731ec1197dbb90d6b0c98cd7dd3b465
blob - d2e422c8e42c1d2acba415753106bfc8ee1086a9
blob + e47921b35f615024740d645645eb9ebc74225ee1
--- lib/diff_main.c
+++ lib/diff_main.c
diff_data_init_subsection(struct diff_data *d, struct diff_data *parent,
struct diff_atom *from_atom, unsigned int atoms_count)
{
- struct diff_atom *last_atom = from_atom + atoms_count - 1;
+ struct diff_atom *last_atom;
+
+ if (atoms_count == 0) {
+ *d = (struct diff_data){
+ .f = NULL,
+ .pos = 0,
+ .data = "",
+ .len = 0,
+ .root = parent->root,
+ .atoms.head = NULL,
+ .atoms.len = atoms_count,
+ };
+
+ return;
+ }
+
+ last_atom = from_atom + atoms_count - 1;
*d = (struct diff_data){
.f = NULL,
.pos = from_atom->pos,
blob - /dev/null
blob + e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (mode 644)
blob - /dev/null
blob + f70f10e4db19068f79bc43844b49f3eece45c4e8 (mode 644)
--- /dev/null
+++ test/test014.right.txt
+A
blob - /dev/null
blob + f70f10e4db19068f79bc43844b49f3eece45c4e8 (mode 644)
--- /dev/null
+++ test/test015.left.txt
+A
blob - /dev/null
blob + e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (mode 644)