shithub: Nail

Download patch

ref: d97ed15a73c00445fd2e5fadc1228f9ef2dfe559
parent: 83e744a4ce3963795d09c469560e13039350c2e6
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Nov 17 12:28:38 EST 2020

thread raising: fix off by one

When raising a thread, we were miscounting the number
of lines to select and move.

--- a/mbox.c
+++ b/mbox.c
@@ -678,8 +678,7 @@
 			nr = r->nsub;
 			if(!(r->state & Sdummy))
 				nr++;
-			assert(nr > 0);
-			fprint(mbox.addr, "%d,%d", ln, ln+nr-1);
+			fprint(mbox.addr, "%d,%d", ln, ln+nr);
 			write(mbox.data, "", 0);
 			reinsert(r);
 		}