]> git.neil.brown.name Git - wiggle.git/commitdiff
vpatch: if backups are disabled, don't try to restore.
authorNeilBrown <neil@brown.name>
Fri, 27 Dec 2019 04:52:05 +0000 (15:52 +1100)
committerNeilBrown <neil@brown.name>
Fri, 27 Dec 2019 04:53:55 +0000 (15:53 +1100)
vpatch (--browse) has a 'R' restore command.  If
backups are disabled it cannot work, so don't try.

Signed-off-by: NeilBrown <neil@brown.name>
vpatch.c

index aba9775b769fce533177ad71d49a9f79aef43326..47e6319fa310d7c8fb80ac594dcf135234e7e846 100644 (file)
--- a/vpatch.c
+++ b/vpatch.c
@@ -2901,6 +2901,8 @@ static void main_window(struct plist *pl, int np, FILE *f, int reverse,
                                mesg = "Cannot restore a folder.";
                        else if (!pl[pos].is_merge)
                                mesg = "File has not been saved, cannot restore.";
+                       else if (!backup)
+                               mesg = "Backups are disabled, nothing to restore!";
                        else {
                                /* rename foo.porig to foo, and clear is_merge */
                                char *file = pl[pos].file;