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

Diff of /lbbs/src/section_list_loader.c

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

Revision 1.40 by sysadm, Tue Sep 30 05:07:46 2025 UTC Revision 1.41 by sysadm, Tue Sep 30 13:27:28 2025 UTC
# Line 206  int append_articles_from_db(int32_t star Line 206  int append_articles_from_db(int32_t star
206          int article_count = 0;          int article_count = 0;
207          int ret = 0;          int ret = 0;
208          int i;          int i;
209            size_t j;
210    
211          db = db_open();          db = db_open();
212          if (db == NULL)          if (db == NULL)
# Line 268  int append_articles_from_db(int32_t star Line 269  int append_articles_from_db(int32_t star
269                  strncpy(article.title, row[i++], sizeof(article.title) - 1);                  strncpy(article.title, row[i++], sizeof(article.title) - 1);
270                  article.title[sizeof(article.title) - 1] = '\0';                  article.title[sizeof(article.title) - 1] = '\0';
271    
272                    // Rewrite title with "Re: Re: " prefix into "Re: ... "
273                    if (article.tid != 0)
274                    {
275                            for (j = 0; strncmp(article.title + j, "Re: ", strlen("Re: ")) == 0; j += strlen("Re: "))
276                                    ;
277                            if (j >= strlen("Re: Re: "))
278                            {
279                                    memcpy(article.title, "Re: ... ", strlen("Re: ... "));
280                                    memmove(article.title + strlen("Re: ... "), article.title + j, sizeof(article.title) - 1 - j);
281                                    article.title[sizeof(article.title) - 1 - j] = '\0';
282                            }
283                    }
284    
285                  article.sub_dt = atol(row[i++]);                  article.sub_dt = atol(row[i++]);
286    
287                  strncpy(sub_ip, row[i++], sizeof(sub_ip) - 1);                  strncpy(sub_ip, row[i++], sizeof(sub_ip) - 1);


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

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