git: 9front

Download patch

ref: 857a996a78c88a3562d5c903290b244722adabb1
parent: 4b847235a1eaa9a94d5da8ab76b91b8e659e255f
author: phil9 <telephil9@gmail.com>
date: Thu May 9 13:18:45 EDT 2024

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.

--- a/sys/src/cmd/vdiff.c
+++ b/sys/src/cmd/vdiff.c
@@ -613,7 +613,7 @@
 	}ARGEND;
 
 	parse(0);
-	if(nblocks==0){
+	if(nblocks==1 && blocks[0]->nlines==0){
 		fprint(2, "no diff\n");
 		exits(nil);
 	}
--