From: NeilBrown Date: Fri, 27 Dec 2019 04:52:05 +0000 (+1100) Subject: vpatch: if backups are disabled, don't try to restore. X-Git-Tag: v1.2~4 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=ff46115a1b3b59765ed89ead38e74409a64e0b56;p=wiggle.git vpatch: if backups are disabled, don't try to restore. vpatch (--browse) has a 'R' restore command. If backups are disabled it cannot work, so don't try. Signed-off-by: NeilBrown --- diff --git a/vpatch.c b/vpatch.c index aba9775..47e6319 100644 --- 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;