shithub: pplay

Download patch

ref: 468c64ccfde97294efce6b1ad9d99b0b6af97bfe
parent: 52558757dbd1132c18b93d865fcbd84b1a54071a
author: qwx <qwx@sciops.net>
date: Tue Dec 6 21:16:36 EST 2022

fix crop command

--- a/cmd.c
+++ b/cmd.c
@@ -462,8 +462,8 @@
 		dot.to.pos -= dot.from.pos;
 		dot.from.pos = 0;
 	}
-	for(Δ=0; c!=&norris; Δ+=c->bufsz, c=c->right)
-		if(Δ + c->bufsz >= dot.to.pos)
+	for(; c!=&norris; dot.to.pos-=c->bufsz, c=c->right)
+		if(c->bufsz >= dot.to.pos)
 			break;
 	if(dot.to.pos > 0)
 		resizechunk(c, dot.to.pos);