Update of /cvsroot/meshdb/src/mailt
In directory usw-pr-cvs1:/tmp/cvs-serv832
Modified Files:
view.c
Log Message:
complete quoted-printable support hackery
Index: view.c
===================================================================
RCS file: /cvsroot/meshdb/src/mailt/view.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- view.c 22 Aug 2002 15:19:14 -0000 1.2
+++ view.c 22 Aug 2002 15:32:28 -0000 1.3
@@ -410,7 +410,7 @@
if (isplain) {
printf("<PRE WRAP=AUTO>");
- printesc(bs, pe);
+ printescqp(bs, pe, isqp(ps, bs));
printf("</PRE>\n");
} else if (bdry2) {
showmixed(v2, ps, pe, &c, id);
@@ -459,7 +459,7 @@
if (isplain) {
printf("<PRE WRAP=AUTO>");
- printesc(bs, pe);
+ printescqp(bs, pe, isqp(ps, bs));
printf("</PRE>\n");
shown = index;
break;
@@ -494,6 +494,8 @@
cstring_t p, s, e, he, hs;
cstring_t bodystart, bodyend;
int killed = (o->m[id].flags & FLAGS_KILLED);
+ int qp;
+ cstring_t ha, hb;
m = o->m + id;
printf("Content-type: text/html\n\n");
@@ -540,27 +542,29 @@
}
printf("<TABLE CLASS=header>");
- if (find1hdr(m, o->mbox, "from", &s, &e)) {
+ ha = o->mbox + m->pos;
+ hb = o->mbox + m->pos + m->hdrlen;
+ if (findhdr(ha, hb, "from", &s, &e)) {
printf("<TR><TH>From:</TH><TD><SPAN CLASS=email>");
printesc(s, e);
printf("</SPAN></TD></TR>\n");
}
- if (find1hdr(m, o->mbox, "to", &s, &e)) {
+ if (findhdr(ha, hb, "to", &s, &e)) {
printf("<TR><TH>To:</TH><TD><SPAN CLASS=email>");
printesc(s, e);
printf("</SPAN></TD></TR>\n");
}
- if (find1hdr(m, o->mbox, "reply-to", &s, &e)) {
+ if (findhdr(ha, hb, "reply-to", &s, &e)) {
printf("<TR><TH>Reply-To:</TH><TD><SPAN CLASS=email>");
printesc(s, e);
printf("</SPAN></TD></TR>\n");
}
- if (find1hdr(m, o->mbox, "date", &s, &e)) {
+ if (findhdr(ha, hb, "date", &s, &e)) {
printf("<TR><TH>Date:</TH><TD>");
printesc(s, e);
printf("</TD></TR>\n");
}
- if (find1hdr(m, o->mbox, "subject", &s, &e)) {
+ if (findhdr(ha, hb, "subject", &s, &e)) {
printf("<TR><TH>Subject:</TH><TD>");
printesc(s, e);
printf("</TD></TR>\n");
@@ -574,7 +578,7 @@
* Do the same with multipart/signed
*/
- if (find1hdr(m, o->mbox, "content-type", &hs, &he)) {
+ if (findhdr(ha, hb, "content-type", &hs, &he)) {
cstring_t *v;
v = hdr_split(hs, he);
s = o->mbox + m->pos;
@@ -592,6 +596,7 @@
"Attachment of type %s</a>", id, v[0], v[0]);
} else {
textplain:
+ qp = isqp(ha, hb);
bodystart = o->mbox + m->pos + m->hdrlen;
bodyend = bodystart + m->bodylen;
@@ -611,7 +616,7 @@
while (q < bodyend && *q != '\n')
q++;
if (gt) printf("<SPAN class=indent%d>", gt);
- printesc(p, q);
+ printescqp(p, q, qp);
if (gt) printf("</SPAN>");
p = q;
if (p < bodyend && *p == '\n') {
@@ -620,7 +625,7 @@
}
}
#else
- printesc(bodystart, bodyend);
+ printescqp(bodystart, bodyend, qp);
#endif
printf("</PRE>");
}
@@ -656,7 +661,7 @@
printf("</UL>\n");
}
- if (find1hdr(m, o->mbox, "message-id", &s, &e)) {
+ if (findhdr(ha, hb, "message-id", &s, &e)) {
printf("<P>[%ld] <SPAN CLASS=messageid>", id);
printesc(s, e);
printf("</SPAN></P\n");
|