mblaze

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

commit 2ad6ae80d8512c985fd613e5340c472582225dcd
parent e34e3dc9ea6a1e24960a084d2137e5e7c450e2dd
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Wed, 10 Aug 2016 18:00:51 +0200

mscan: make negative width in %f, %s mean "rest minus N"

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

diff --git a/mscan.c b/mscan.c @@ -36,8 +36,6 @@ static char *fflag = default_fflag; int u8putstr(FILE *out, char *s, ssize_t l, int pad) { - if (l < 0) - l = -l; ssize_t ol = l; while (*s && l > 0) { @@ -378,6 +376,8 @@ oneline(char *file) fmt_date(msg, w, Iflag || *f == 'D')); break; case 'f': + if (w < 0) + w += wleft; if (w) wleft -= u8putstr(stdout, fmt_from(msg), w, 1); @@ -403,6 +403,8 @@ oneline(char *file) break; case 's': case 'S': + if (w < 0) + w += wleft; if (w) wleft -= u8putstr(stdout, fmt_subject(msg, file, *f == 'S'), w, 1);