"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: diff.git: Fix ed script output
To:
Tom Jones <thj@freebsd.org>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 5 Sep 2022 18:39:20 +0200

Download raw body.

Thread
On Mon, Sep 05, 2022 at 04:21:40PM +0100, Tom Jones wrote:
> Following patch is updated to update the line offsets in the same way
> that diff_output_plain.c does.

> +	/* Now write out the new lines in all the joined chunks. */
> +	int c_idx;
> +	for (c_idx = cc->chunk.start; c_idx < cc->chunk.end; c_idx++) {
> +		const struct diff_chunk *c = &result->chunks.head[c_idx];
> +		if (c->left_count && !c->right_count)
> +				continue;
> +		if (c->right_count && !c->left_count) {
> +			rc = diff_output_lines(outinfo, dest,
> +					  c->solved ? "" : "?",
> +					  c->right_start, c->right_count);
> +			fprintf(dest, ".\n");
> +		}
> +		if (rc)
> +			return rc;

The above fprintf seems to be missing a corresponding line offset update.