| 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; |
| 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 |
{ |
{ |
| 144 |
prints(" \033[1;33m[提示]\033[m %c %s%*s %s %s%s\033[m", |
prints(" \033[1;33m[提示]\033[m %c %s%*s %s %s%s\033[m", |
| 145 |
article_flag, |
article_flag, |
| 146 |
(display_nickname ? p_articles[i]->nickname : p_articles[i]->username), |
(display_nickname ? p_articles[i]->nickname : p_articles[i]->username), |
| 147 |
(display_nickname ? BBS_nickname_max_len - (int)strnlen(p_articles[i]->nickname, sizeof(p_articles[i]->nickname)) |
(display_nickname ? BBS_nickname_max_len / 2 - str_length(p_articles[i]->nickname, 1) |
| 148 |
: BBS_username_max_len - (int)strnlen(p_articles[i]->username, sizeof(p_articles[i]->username))), |
: BBS_username_max_len - str_length(p_articles[i]->username, 1)), |
| 149 |
"", |
"", |
| 150 |
str_time, |
str_time, |
| 151 |
(p_articles[i]->aid == section_topic_view_tid |
(p_articles[i]->aid == section_topic_view_tid |
| 166 |
p_articles[i]->aid, |
p_articles[i]->aid, |
| 167 |
article_flag, |
article_flag, |
| 168 |
(display_nickname ? p_articles[i]->nickname : p_articles[i]->username), |
(display_nickname ? p_articles[i]->nickname : p_articles[i]->username), |
| 169 |
(display_nickname ? BBS_nickname_max_len - (int)strnlen(p_articles[i]->nickname, sizeof(p_articles[i]->nickname)) |
(display_nickname ? BBS_nickname_max_len / 2 - str_length(p_articles[i]->nickname, 1) |
| 170 |
: BBS_username_max_len - (int)strnlen(p_articles[i]->username, sizeof(p_articles[i]->username))), |
: BBS_username_max_len - str_length(p_articles[i]->username, 1)), |
| 171 |
"", |
"", |
| 172 |
str_time, |
str_time, |
| 173 |
(p_articles[i]->aid == section_topic_view_tid |
(p_articles[i]->aid == section_topic_view_tid |