/[LeafOK_CVS]/lbbs/src/section_list_display.c
ViewVC logotype

Diff of /lbbs/src/section_list_display.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.41 by sysadm, Tue Sep 30 04:56:16 2025 UTC Revision 1.42 by sysadm, Tue Sep 30 14:56:51 2025 UTC
# Line 61  static int section_list_draw_items(int p Line 61  static int section_list_draw_items(int p
61          int eol;          int eol;
62          int len;          int len;
63          int i;          int i;
64            size_t j;
65          char article_flag;          char article_flag;
66          int is_viewed;          int is_viewed;
67          time_t tm_now;          time_t tm_now;
# Line 111  static int section_list_draw_items(int p Line 112  static int section_list_draw_items(int p
112                  strncpy(title_f, (p_articles[i]->tid == 0 ? "● " : ""), sizeof(title_f) - 1);                  strncpy(title_f, (p_articles[i]->tid == 0 ? "● " : ""), sizeof(title_f) - 1);
113                  title_f[sizeof(title_f) - 1] = '\0';                  title_f[sizeof(title_f) - 1] = '\0';
114                  strncat(title_f, (p_articles[i]->transship ? "[转载]" : ""), sizeof(title_f) - 1 - strnlen(title_f, sizeof(title_f)));                  strncat(title_f, (p_articles[i]->transship ? "[转载]" : ""), sizeof(title_f) - 1 - strnlen(title_f, sizeof(title_f)));
115                  strncat(title_f, p_articles[i]->title, sizeof(title_f) - 1 - strnlen(title_f, sizeof(title_f)));  
116                    // Rewrite title with "Re: Re: " prefix into "Re: ... "
117                    j = 0;
118                    if (p_articles[i]->tid != 0)
119                    {
120                            while (strncmp(p_articles[i]->title + j, "Re: ", strlen("Re: ")) == 0)
121                            {
122                                    j += strlen("Re: ");
123                            }
124                            if (j >= strlen("Re: Re: "))
125                            {
126                                    strncat(title_f, "Re: ... ", sizeof(title_f) - 1 - strnlen(title_f, sizeof(title_f)));
127                            }
128                            else
129                            {
130                                    j = 0;
131                            }
132                    }
133                    strncat(title_f, p_articles[i]->title + j, sizeof(title_f) - 1 - strnlen(title_f, sizeof(title_f)));
134    
135                  len = split_line(title_f, 47 - (display_nickname ? 8 : 0), &eol, &title_f_len, 1);                  len = split_line(title_f, 47 - (display_nickname ? 8 : 0), &eol, &title_f_len, 1);
136                  if (title_f[len] != '\0')                  if (title_f[len] != '\0')
137                  {                  {


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1