From 025a2d172ebfe36bc0da32f5712dd250916c73f1 Mon Sep 17 00:00:00 2001 From: phil9 Date: Thu, 9 May 2024 17:18:45 +0000 Subject: [PATCH] vdiff: exit if diff is empty currently vdiff will display an empty window if there is no diff. Print a message and exit early instead. --- sys/src/cmd/vdiff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/cmd/vdiff.c b/sys/src/cmd/vdiff.c index c8e5a8c4e..d48f1741f 100644 --- a/sys/src/cmd/vdiff.c +++ b/sys/src/cmd/vdiff.c @@ -613,7 +613,7 @@ threadmain(int argc, char *argv[]) }ARGEND; parse(0); - if(nblocks==0){ + if(nblocks==1 && blocks[0]->nlines==0){ fprint(2, "no diff\n"); exits(nil); }