Skip to content

Commit

Permalink
vpatch: if backups are disabled, don't try to restore.
Browse files Browse the repository at this point in the history
vpatch (--browse) has a 'R' restore command.  If
backups are disabled it cannot work, so don't try.

Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
neilbrown committed Dec 27, 2019
1 parent d98d874 commit ff46115
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vpatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ff46115

Please sign in to comment.