--- msg.c 2001/09/12 14:35:14 1.18
+++ msg.c 2001/11/14 14:22:25 1.19
@@ -258,6 +258,8 @@
char cOld;
int n;
char *cpHeaders;
+ char *azNewheaders;
+ size_t asNewheaders;
log0(msg, DEBUG, "verify Newsgroups");
if (msg->azNewsgroups == NULL)
@@ -304,6 +306,8 @@
* Fragments exceeding WRAPAT characters without having a blank as a
* splitting point are forcibly cut at a non-blank character.
*/
+ azNewheaders = NULL;
+ asNewheaders = 0;
cp = NULL;
while ((cp = argz_next(msg->azHeaders, msg->asHeaders, cp)) != NULL) {
if (strlen(cp) > WRAPAT) {
@@ -341,11 +345,18 @@
strcat(cpWrap, WRAPUSING);
strcat(cpWrap, cpRem);
}
- argz_delete(&msg->azHeaders, &msg->asHeaders, cp);
- argz_insert(&msg->azHeaders, &msg->asHeaders, cp, cpWrap);
+ argz_add(&azNewheaders, &asNewheaders, cpWrap);
+ log2(msg, DEBUG, "a folded header \"%{text}D\"", cpWrap, strlen(cpWrap));
free(cpWrap);
}
+ else {
+ argz_add(&azNewheaders, &asNewheaders, cp);
+ log2(msg, DEBUG, "verbatim header \"%{text}D\"", cp, strlen(cp));
+ }
}
+ free(msg->azHeaders);
+ msg->azHeaders = azNewheaders;
+ msg->asHeaders = asNewheaders;
log0(msg, DEBUG, "strigify headers");
argz_stringify(msg->azHeaders, msg->asHeaders, '\n');
|