[PATCH] group.c:show_group_title(): small cosmetic issue

Dennis Preiser <[email protected]> Sun, 27 Sep 2009 23:37:37 +0200
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
Hello,

when using tin with '-n' (or '-Q'...) the status (moderated etc.) of  
a newsgroup is unknown. This results with inverse_ok == TRUE in a  
title (group page) like this:

                de.comp.os.unix.linux.misc (87B 826+ 0* 0K)
                ^                                            ^

The '^' are marking the beginning and end of inverse video. Attached  
patch changes this in a way that the title (in case of '-n' or '-Q'  
and inverse_ok == TRUE) looks like this:

                de.comp.os.unix.linux.misc (87B 826+ 0* 0K)
                ^                                         ^

The '^' are marking the beginning and end of inverse video again.

Dennis

diff -urp tin-1.9.5_r3/src/group.c tin-1.9.5_r4/src/group.c
--- tin-1.9.5_r3/src/group.c	2009-09-26 11:48:40.000000000 +0200
+++ tin-1.9.5_r4/src/group.c	2009-09-27 20:18:05.000000000 +0200
@@ -1384,7 +1384,7 @@ static void
  show_group_title(
  	t_bool clear_title)
  {
-	char buf[LEN], tmp[LEN];
+	char buf[LEN], tmp[LEN], flag;
  	int i, art_cnt = 0, recent_art_cnt = 0, selected_art_cnt = 0,  
read_selected_art_cnt = 0, killed_art_cnt = 0;

  	for_each_art(i) {
@@ -1462,8 +1462,10 @@ show_group_title(
  		strcat(buf, tmp);

  	/* group flag */
-	snprintf(tmp, sizeof(tmp), ") %c",
-		group_flag(curr_group->moderated));
+	if ((flag = group_flag(curr_group->moderated)) == ' ')
+		snprintf(tmp, sizeof(tmp), ")");
+	else
+		snprintf(tmp, sizeof(tmp), ") %c", flag);
  	if (sizeof(buf) > strlen(buf) + strlen(tmp))
  		strcat(buf, tmp);