@@ -242,17 +242,23 @@ static void format_thread_info(FILE *fp, struct emailinfo *email,
242
242
struct emailinfo * subdir_email , FILE * fp_body ,
243
243
int threadnum , bool is_first )
244
244
{
245
- char * subj ;
245
+ char * subj , * tmpname ;
246
246
char * href = NULL ;
247
247
char buffer [256 ];
248
248
char * first_attributes = (is_first ) ? " accesskey=\"j\" name=\"first\" id=\"first\"" : "" ;
249
249
250
+ #ifdef HAVE_ICONV
251
+ subj = convchars (email -> subject , "utf-8" );
252
+ tmpname = convchars (email -> name , "utf-8" );
253
+ #else
250
254
subj = convchars (email -> subject , email -> charset );
255
+ tmpname = convchars (email -> name , email -> charset );
256
+ #endif
251
257
252
258
if (set_files_by_thread ) {
253
259
int maybe_reply = 0 ;
254
260
int is_reply = 1 ;
255
- fprintf (fp_body , "<a name =\"%.4d\"></a>" , email -> msgnum );
261
+ fprintf (fp_body , "<a name =\"%.4d\" id=\"%.4d\" ></a>" , email -> msgnum , email -> msgnum );
256
262
print_headers (fp_body , email , TRUE);
257
263
if ((set_show_msg_links && set_show_msg_links != 4 ) || !set_usetable ) {
258
264
fprintf (fp_body , "</ul>\n" );
@@ -273,22 +279,25 @@ static void format_thread_info(FILE *fp, struct emailinfo *email,
273
279
if (set_indextable ) {
274
280
fprintf (fp ,
275
281
"<tr><td>%s<a href=\"%s\"%s><strong>%s</strong></a></td>"
276
- "<td nowrap><a name=\"%d\">%s</a></td>" "<td nowrap>%s</td></tr>\n" ,
282
+ "<td nowrap><a name=\"%d\" id=\"%d\" >%s</a></td>" "<td nowrap>%s</td></tr>\n" ,
277
283
level > 1 ? "--> " : "" ,
278
284
href , first_attributes ,
279
- subj , email -> msgnum , email -> name , getindexdatestr (email -> date ));
285
+ subj , email -> msgnum , email -> msgnum , tmpname , getindexdatestr (email -> date ));
280
286
}
281
287
else {
282
288
if (num_open_li [level ] != 0 ) {
283
289
fprintf (fp , "</li>\n" );
284
290
num_open_li [level ]-- ;
285
291
}
286
292
fprintf (fp , "<li><a href=\"%s\"%s>%s</a> "
287
- "<a name=\"%d\"><em>%s</em></a> <em>(%s)</em>\n" ,
293
+ "<a name=\"%d\" id=\"%d\" ><em>%s</em></a> <em>(%s)</em>\n" ,
288
294
href , first_attributes ,
289
- subj , email -> msgnum , email -> name , getindexdatestr (email -> date ));
295
+ subj , email -> msgnum , email -> msgnum , tmpname , getindexdatestr (email -> date ));
290
296
}
291
- free (subj );
297
+ if (subj )
298
+ free (subj );
299
+ if (tmpname )
300
+ free (tmpname );
292
301
++ num_replies [level ];
293
302
if (!set_indextable )
294
303
++ num_open_li [level ];
0 commit comments