little bug fix

Pablo Saratxaga (srtxg@linux.chanae.stben.be)
Thu, 7 Nov 1996 04:52:25 +0100 (MET)

Hello,

There is a little patch:

--- ifgate/getmessage.c.orig Thu Nov 7 04:16:24 1996
+++ ifgate/getmessage.c Thu Nov 7 04:17:49 1996
@@ -167,7 +167,9 @@
p=strchr(l,':');
r=strchr(l,' ');
if (p && (!r || (r > p))) r=p;
+ else p=r;
if (r == NULL) badkludge=1;
+ else if (!*(p+1) || (*(p+1)=='\n')) badkludge=1;

*tmsg=(rfcmsg *)xmalloc(sizeof(rfcmsg));
(*tmsg)->next=NULL;
--- ifgate/message.c.orig Thu Nov 7 04:21:04 1996
+++ ifgate/message.c Thu Nov 7 04:39:51 1996
@@ -158,6 +158,7 @@
rfcmsg *tmp;
int rfcheaders;
int needsplit,hdrsize,datasize,splitpart,forbidsplit;
+ int sot_kludge, eot_kludge;
int tinyorigin=0;
faddr *ta;
fa_list *tmpl;
@@ -180,6 +181,8 @@
removeorg=0;
removeref=0;
ftnorigin=fmsg->ftnorigin;
+ sot_kludge=0;
+ eot_kludge=0;

if (((p=hdr("Content-Type",msg))) &&
((q=hdr("Content-Transfer-Encoding",msg))))
@@ -324,13 +327,24 @@
strcasecmp(tmp->key,"X-FTN-PATH") &&
strcasecmp(tmp->key,"X-FTN-REPLYADDR") &&
strcasecmp(tmp->key,"X-FTN-REPLYTO") &&
+ strcasecmp(tmp->key,"X-FTN-To") &&
+ strcasecmp(tmp->key,"X-FTN-From") &&
+ strcasecmp(tmp->key,"X-FTN-SOT") &&
+ strcasecmp(tmp->key,"X-FTN-EOT") &&
strcasecmp(tmp->key,"X-FTN-Via"))
if (strcasecmp(tmp->key,"X-FTN-KLUDGE") == 0)
{
- hdrsize += strlen(tmp->val);
- fprintf(pkt,"\1");
+ if (!strcasecmp(tmp->val,"SOT"))
+ sot_kludge=1;
+ else if (!strcasecmp(tmp->val,"EOT"))
+ eot_kludge=1;
+ else
+ {
+ hdrsize += strlen(tmp->val);
+ fprintf(pkt,"\1");
/* we should have restored the original string here... */
- kwrite(tmp->val,pkt);
+ kwrite(tmp->val,pkt);
+ }
}
else
{
@@ -360,6 +374,8 @@
cwrite(tmp->val,pkt);
}
if (rfcheaders) cwrite("\n",pkt);
+ if ((hdr("X-FTN-SOT",msg)) || (sot_kludge))
+ fprintf(pkt,"\1SOT:\r");
}

if (replyaddr)
@@ -396,6 +412,8 @@
fprintf(pkt,"\r * Message split, to be continued *\r");
splitpart++;
}
+ if ((p=hdr("X-FTN-EOT",msg)) || (eot_kludge))
+ fprintf(pkt,"\1EOT:\r");

if ((p=hdr("X-FTN-Tearline",msg)))
{

It handle correctly kludges like "^aSOT:\r".
And the patch to message.c is to handle SOT/EOT back.
And don't create kludge lines fore X-FTN-To: and X-FTN-From: (equivalent
of ifmail X-Comment-To and X-FTN-Sender, and already handled in mkftnhdr.c)
patch made agains ifmail-2.8g

-- 

A bientôt, Pablo Saratxaga

~ ~ :wq ;-) PGP Key available, key ID: 0x8F0E4975