Skip to content

Commit cfd2d71

Browse files
author
Peter McCluskey
committed
Fixes to files_by_thread option submitted by Oliver Meili
1 parent 4dd093b commit cfd2d71

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

Changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
Version Changes for Hypermail
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Peter McCluskey (Mar 19, 2005)
4+
Fixes to files_by_thread option submitted by Oliver Meili.
5+
6+
Peter McCluskey (Dec 2, 2004)
7+
Patch from Ulf H�rnhammar to fix two format string bugs in Hypermail.
8+
They could have caused crashes if using incremental mode on edited
9+
pre-existing archives with data like "%n%n%n%n%n%n%n%n" in certain lines.
10+
311
Peter McCluskey (Nov 28, 2004)
412
Add filename_base option.
513

src/print.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ void printheaders (FILE *fp, struct emailinfo *email)
10691069
d_index = MSG_EXPIRED;
10701070
if (email->is_deleted == 4 || email->is_deleted == 8)
10711071
d_index = MSG_FILTERED_OUT;
1072-
fprintf(fp, "<a name=\"start\" accesskey=\"j\" id=\"start\"></a>");
1072+
fprintf(fp, "<a name=\"start%d\" accesskey=\"j\" id=\"start\"></a>", email->msgnum);
10731073
fprintf(fp, "<p>%s</p>\n", lang[d_index]); /* AUDIT biege: No more warnings about format-bug */
10741074
return;
10751075
}
@@ -1164,14 +1164,14 @@ void printbody(FILE *fp, struct emailinfo *email, int maybe_reply, int is_reply)
11641164
d_index = MSG_EXPIRED;
11651165
if (email->is_deleted == 4 || email->is_deleted == 8)
11661166
d_index = MSG_FILTERED_OUT;
1167-
fprintf(fp, "<a name=\"start\" accesskey=\"j\" id=\"start\"></a>");
1167+
fprintf(fp, "<a name=\"start%d\" accesskey=\"j\" id=\"start\"></a>", email->msgnum);
11681168
fprintf(fp, "<p>%s</p>\n", lang[d_index]); /* AUDIT biege: No more warnings about format-bug */
11691169
return;
11701170
}
11711171

11721172
if (!set_showhtml) {
11731173
fprintf(fp, "<pre id=\"body\">\n");
1174-
fprintf(fp, "<a name=\"start\" accesskey=\"j\" id=\"start\"></a>");
1174+
fprintf(fp, "<a name=\"start%d\" accesskey=\"j\" id=\"start\"></a>", email->msgnum);
11751175
pre = TRUE;
11761176
}
11771177

@@ -1496,8 +1496,8 @@ int print_links_up(FILE *fp, struct emailinfo *email, int pos, int in_thread_fil
14961496

14971497
fprintf(fp, "<li>\n");
14981498
fprintf(fp, "<dfn>%s</dfn>:\n", lang[MSG_THIS_MESSAGE]);
1499-
fprintf(fp, "[ <a href=\"#start\" name=\"options1\" id=\"options1\" tabindex=\"1\">"
1500-
"%s</a> ]\n", lang[MSG_MSG_BODY]);
1499+
fprintf(fp, "[ <a href=\"#start%d\" name=\"options1\" id=\"options1\" tabindex=\"1\">"
1500+
"%s</a> ]\n", email->msgnum, lang[MSG_MSG_BODY]);
15011501
if (set_mailcommand && set_hmail) {
15021502
if ((email->msgid && email->msgid[0]) || (email->subject && email->subject[0])) {
15031503
ptr = makemailcommand(set_replymsg_command, set_hmail, email->msgid,
@@ -1638,8 +1638,8 @@ int print_links(FILE *fp, struct emailinfo *email, int pos, int in_thread_file)
16381638
** format for items: <li><dfn>Next</dfn>: <a href="0047.html"
16391639
title="wai thing">subject of message</a></li>\n */
16401640

1641-
fprintf (fp, "<li><dfn>%s</dfn>: [ <a href=\"#start\">%s</a> ]</li>\n",
1642-
lang[MSG_THIS_MESSAGE], lang[MSG_MSG_BODY]);
1641+
fprintf (fp, "<li><dfn>%s</dfn>: [ <a href=\"#start%d\">%s</a> ]</li>\n",
1642+
lang[MSG_THIS_MESSAGE], email->msgnum, lang[MSG_MSG_BODY]);
16431643

16441644
printcomment(fp, "lnext", "start");
16451645
/*

src/threadprint.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,20 +251,20 @@ static void format_thread_info(FILE *fp, struct emailinfo *email,
251251

252252
if (set_files_by_thread) {
253253
int maybe_reply = 0;
254-
int is_reply;
254+
int is_reply = 1;
255255
fprintf(fp_body, "<a name =\"%.4d\"></a>", email->msgnum);
256256
print_headers(fp_body, email, TRUE);
257-
is_reply = print_links(fp_body, email, PAGE_TOP, TRUE);
258257
if ((set_show_msg_links && set_show_msg_links != 4) || !set_usetable) {
259258
fprintf(fp_body, "</ul>\n");
260259
}
261260
/* maybe_reply only affects code in finelink.c which we don't want to run twice? */
262261
printbody(fp_body, email, maybe_reply, is_reply);
263262
if (level == 0) {
264-
sprintf(buffer, "<a href=\"thread_body%d.%s\">",
263+
sprintf(buffer, "thread_body%d.%s",
265264
threadnum, set_htmlsuffix);
266265
href = buffer;
267266
}
267+
is_reply = print_links(fp_body, email, PAGE_TOP, TRUE);
268268
}
269269
if (!href)
270270
href = msg_href(email, subdir_email, FALSE);

0 commit comments

Comments
 (0)