From ff46115a1b3b59765ed89ead38e74409a64e0b56 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 27 Dec 2019 15:52:05 +1100 Subject: [PATCH] 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 --- vpatch.c | 2 ++ 1 file changed, 2 insertions(+) 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;