From: Stefan Sperling Subject: Re: diff.git: Fix ed script output To: Tom Jones Cc: gameoftrees@openbsd.org Date: Sat, 3 Sep 2022 09:39:12 +0200 On Tue, Aug 30, 2022 at 02:47:58PM +0100, Tom Jones wrote: > Prior to this change ed script output was in the wrong order, i.e. in > the order diff_result provides and changes where missing added or > changed lines. ed edits need to be in reverse order to keep the edited > file in sync The onnly blocking problem with this patch I can see is that output line offsets aren't being filled in correctly. For example: + rc = fprintf(dest, "%d,%dc\n", left_start, cc->left.end); + } + } ... here, 'rc' should be used to update the line offsets array. + + /* Now write out the new lines in all the joined chunks. */