From: markus schnalke Date: Sat, 7 Jul 2012 09:13:18 +0000 (+0200) Subject: whom: Suppress the separator if no hidden rcpts are present. X-Git-Tag: mmh-thesis-end~10 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=921ea2dd0444ebe67a980b54b8017125d371c8e6 whom: Suppress the separator if no hidden rcpts are present. --- diff --git a/man/whom.man1 b/man/whom.man1 index 718ef2e..b40787b 100644 --- a/man/whom.man1 +++ b/man/whom.man1 @@ -28,10 +28,14 @@ option suppresses the listing of sighted recipients. The .BR \-nobcc option suppresses the listing of hidden recipients. -If both kinds of recipients are requested, they are separated by a -line similar to ``\0==BCC==''. +If the printing of both kinds of recipients, visible and hidden, +is requested and hidden recipients are present, +they are separated by a line similar to ``\0==BCC==''. The actual separator may change, but the regular expression /^[\0\\t].*BCC/ should always match. +No separator is printed if only one kind of recipients is requested +for printing, or if both are requested but no hidden recipients are +present. .PP With .BR \-alias , diff --git a/uip/whom.c b/uip/whom.c index 0451699..8ffe8b8 100644 --- a/uip/whom.c +++ b/uip/whom.c @@ -153,10 +153,6 @@ main(int argc, char **argv) free(cmd); naddrs += n; - if (toccsw && bccsw) { - puts(separator); - } - cmd = add("ali -list", NULL); if ((n=printbcc()) && alisw) { if (!(in = popen(cmd, "r"))) { @@ -314,6 +310,9 @@ printbcc(void) continue; } if (mp->m_type & HBCC) { + if (!naddrs && toccsw) { + puts(separator); + } naddrs++; printone(mp); }