+
+ /* Assign line numbers for this parent.
+ *
+ * sline[lno].p_lno[n] records the first line number
+ * (counting from 1) for parent N if the final hunk display
+ * started by showing sline[lno] (possibly showing the lost
+ * lines attached to it first).
+ */
+ for (lno = 0, p_lno = 1; lno < cnt; lno++) {
+ struct lline *ll;
+ sline[lno].p_lno[n] = p_lno;
+
+ /* How many lines would this sline advance the p_lno? */
+ ll = sline[lno].lost_head;
+ while (ll) {
+ if (ll->parent_map & nmask)
+ p_lno++; /* '-' means parent had it */
+ ll = ll->next;
+ }
+ if (!(sline[lno].flag & nmask))
+ p_lno++; /* no '+' means parent had it */
+ }
+ sline[lno].p_lno[n] = p_lno; /* trailer */