Bug #1318

undo" utility patch (second [-t transaction-id]

Added by joelkp over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


Hello (from a user you've never heard of or from before),

I noticed when poking around in src/usr.bin/undo/undo.c that while
something is read and stored from the second [-t transaction-id]
argument, it is not actually used subsequently. Man page says:

A second -t specification may be given when the -d or -D option
is used, to provide two end-points for the diff. The file as-of
the second -t is used instead of the current version of the file.

But this does not happen, since ts2.tid is never used after being set
in main() - ts1 is passed on to doiterate, but not ts2. Subsequently,
another ts2 comes of use in the doiterate function.

As a result, for example, using "undo -d" followed by two identical -t
arguments for a file does not result in an empty diff, but rather the
exact same diff as with one instance of the transaction id. This
simple patch fixes that.

undo.patch Magnifier (1.2 KB) joelkp, 03/22/2009 03:22 PM


#1 Updated by corecode over 7 years ago

committed in 965778c8e5068e125ea2aa029359fdf88d1e5dfc (enhanced)

Also available in: Atom PDF