mblaze

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

commit 26f694c91d04edeb374a53fad60d63a87c0bf065
parent f628a10ff6c8e359036984c0a37a9cd1d3784914
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Thu,  4 Aug 2016 19:12:20 +0200

mscan: support \n and \t

Diffstat:
mscan.c | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/mscan.c b/mscan.c @@ -248,6 +248,7 @@ oneline(char *file) nomsg: flag1 = flag2 = flag3 = ' '; *fromdec = 0; + flags = ""; snprintf(subjdec, sizeof subjdec, "\\_ %s", file); lineno = 0; } @@ -256,6 +257,17 @@ nomsg: char *f; for (f = fflag; *f; f++) { + if (*f == '\\') { + f++; + switch (*f) { + case 'n': putchar('\n'); wleft = cols; break; + case 't': putchar('\t'); wleft -= (8 - wleft % 8); break; + default: + putchar('\\'); wleft--; + putchar(*f); wleft--; + } + continue; + } if (*f != '%') { putchar(*f); wleft--; @@ -277,7 +289,7 @@ nomsg: if (!*f) break; - switch(*f) { + switch (*f) { case '%': putchar('%'); wleft--;