Page MenuHomeFreeBSD

diff3: allow diff3 ed scripts to generate deletions

Authored by thj on Apr 14 2022, 3:28 PM.



diff3 with the -e (ed script flag) can generate line deletions, add support for
deletions and add a test case to exercise this behaviour. This functionality
was unearthed through comparison of bsd diff3 and gnu diff3 output.

Diff Detail

rS FreeBSD src repository - subversion
Lint OK
No Unit Test Coverage
Build Status
Buildable 45183
Build 42071: arc lint + arc unit

Event Timeline

thj requested review of this revision.Apr 14 2022, 3:28 PM

I would use bool. It's a minor nit, but I think this code is unclear as it is.


The value of the boolean expression is used only once, so maybe it would be better to evaluate it directly in the function call?
Otherwise I would change the type of delete and move it to the if block - it doesn't seem to be used anywhere else.


I'll convert it to bool, I think having a variable helps make the code a little clearer here.

When -A and -m output modes come in they use the value of delete and I think consistency between the three output modes is a good idea.

  • Only end ed input stream if we aren't issuing a delete
This revision is now accepted and ready to land.Apr 15 2022, 1:55 PM
  • pass bool into prange in change
This revision now requires review to proceed.Apr 15 2022, 1:56 PM
This revision is now accepted and ready to land.Apr 15 2022, 1:57 PM