summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2003-08-07 08:52:53 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2003-08-07 08:52:53 +0000
commit7f2b2ef2e58660dac58860e2bc4f85fa9ce3be83 (patch)
treecb4ce5b33ab74baf9aeba52043cac838b0ce81b8
parent02bc3fa5df5826ab3f2e96095a78e20e2b0dfc1e (diff)
downloadmailutils-7f2b2ef2e58660dac58860e2bc4f85fa9ce3be83.tar.gz
mailutils-7f2b2ef2e58660dac58860e2bc4f85fa9ce3be83.tar.bz2
(FAST_HEADER): Do not remove intermediate newlines from the folded headers.
-rw-r--r--mailbox/mbox/mboxscan.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mailbox/mbox/mboxscan.c b/mailbox/mbox/mboxscan.c
index 0d136e156..f850ec165 100644
--- a/mailbox/mbox/mboxscan.c
+++ b/mailbox/mbox/mboxscan.c
@@ -389,3 +389,6 @@ do {\
-/* Save/concatenate the field-value in the fast header(fhd) field. */
+/* Save/concatenate the field-value in the fast header(fhd) field.
+ Notice that care is taken to preserve the intermediate newlines
+ in the folded headers. However, the final newline is always
+ removed. */
#define FAST_HEADER(field,buf,n) \
@@ -408,3 +411,3 @@ do { \
l = n - (p - buf); \
- tmp = realloc (field, (l + i + 1) * sizeof (char)); \
+ tmp = realloc (field, (l + (i ? i + 1 : 0) + 1) * sizeof (char)); \
if (tmp) \
@@ -412,2 +415,3 @@ do { \
field = tmp; \
+ if (i) field[i++] = '\n'; \
memcpy (field + i, p, l); \

Return to:

Send suggestions and report system problems to the System administrator.