From 921ea2dd0444ebe67a980b54b8017125d371c8e6 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Sat, 7 Jul 2012 11:13:18 +0200 Subject: [PATCH] whom: Suppress the separator if no hidden rcpts are present. --- man/whom.man1 | 8 ++++++-- uip/whom.c | 7 +++---- 2 files changed, 9 insertions(+), 6 deletions(-) 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); } -- 1.7.10.4