shithub: Nail

Download patch

ref: 74c01104800ced699d26b9f025626e60874799f9
parent: 9d6d47c52cd0b0c4c7233c4e042748ebcd140cbc
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Nov 13 14:45:00 EST 2020

Fix another off-by-n rendering error: preserve nsub when replacing dummies.

--- a/mbox.c
+++ b/mbox.c
@@ -343,7 +343,7 @@
 load(char *name, char *digest, int ins)
 {
 	Mesg *m, *p, **c;
-	int nc;
+	int nc, ns;
 
 	if(strncmp(name, mbox.path, strlen(mbox.path)) == 0)
 		name += strlen(mbox.path);
@@ -356,6 +356,7 @@
 	if((p = lookupid(m->messageid)) != nil){
 		c = p->child;
 		nc = p->nchild;
+		ns = p->nsub;
 		mesgclear(p);
 		memcpy(p, m, sizeof(*p));
 		free(m);
@@ -363,6 +364,7 @@
 		m = p;
 		m->child = c;
 		m->nchild = nc;
+		m->nsub = ns;
 	}else
 		addmesg(m, ins);