shithub: riscv

Download patch

ref: 025a2d172ebfe36bc0da32f5712dd250916c73f1
parent: 039015ad71aaacb6144c9b352f764432646d8b1e
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);
 	}