mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit e97bf25a4e16baa46e91d74d76aabdaf8abe4ad5
parent 3f1fb14ecd0ef14e0bb3cd6a4a119c2b7ccf0038
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Thu,  4 Aug 2016 19:39:01 +0200

mscan: look up message number when needed

Diffstat:
mscan.c | 15+++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/mscan.c b/mscan.c @@ -242,7 +242,6 @@ oneline(char *file) struct message *msg = blaze822(file); char *flags = msg ? strstr(file, ":2,") : ""; - long lineno = msg ? blaze822_seq_find(file) : 0; int wleft = cols; @@ -320,11 +319,15 @@ oneline(char *file) wleft -= printf("%.*s", w, flags); break; case 'n': - if (lineno) - printf("%*ld", w, lineno); - else - printf("%*s", w, ""); - wleft -= w > 0 ? w : -w; + { + long lineno = msg ? blaze822_seq_find(file) : 0; + + if (lineno) + printf("%*ld", w, lineno); + else + printf("%*s", w, ""); + wleft -= w > 0 ? w : -w; + } break; case 'd': case 'D':