Changeset 456:da859aef10ab
- Timestamp:
- 1998-10-14 18:17:41 (10 years ago)
- Author:
- Thomas Roessler <roessler@…>
- Branch:
- HEAD
- Message:
-
Fixing a memory hog which was introduced by the edit-message patch.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r437
|
r456
|
|
| 98 | 98 | |
| 99 | 99 | hdr = mutt_new_header (); |
| 100 | | mutt_read_rfc822_header (f, hdr); |
| | 100 | mutt_read_rfc822_header (f, hdr, 0); |
| 101 | 101 | if (!(hdr->read || hdr->old)) |
| 102 | 102 | result = 1; |
-
|
r437
|
r456
|
|
| 130 | 130 | ifp = fopen (path, "r"); |
| 131 | 131 | ofp = safe_fopen (body, "w"); |
| 132 | | n = mutt_read_rfc822_header (ifp, NULL); |
| | 132 | n = mutt_read_rfc822_header (ifp, NULL, 1); |
| 133 | 133 | while ((i = fread (buffer, 1, sizeof (buffer), ifp)) > 0) |
| 134 | 134 | fwrite (buffer, 1, i, ofp); |
-
|
r437
|
r456
|
|
| 532 | 532 | ctx->hdrs[ctx->msgcount]->index = ctx->msgcount; |
| 533 | 533 | |
| 534 | | ctx->hdrs[msgno]->env = mutt_read_rfc822_header (fp, ctx->hdrs[msgno]); |
| | 534 | ctx->hdrs[msgno]->env = mutt_read_rfc822_header (fp, ctx->hdrs[msgno], 0); |
| 535 | 535 | ploc=ftell(fp); |
| 536 | 536 | ctx->hdrs[msgno]->read = h->read; |
-
|
r446
|
r456
|
|
| 569 | 569 | |
| 570 | 570 | if (draftFile) |
| 571 | | msg->env = mutt_read_rfc822_header (fin, NULL); |
| | 571 | msg->env = mutt_read_rfc822_header (fin, NULL, 1); |
| 572 | 572 | |
| 573 | 573 | if (tempfile) |
-
|
r437
|
r456
|
|
| 136 | 136 | hdr->received = t + tz; |
| 137 | 137 | |
| 138 | | hdr->env = mutt_read_rfc822_header (ctx->fp, hdr); |
| | 138 | hdr->env = mutt_read_rfc822_header (ctx->fp, hdr, 0); |
| 139 | 139 | |
| 140 | 140 | loc = ftell (ctx->fp); |
| … |
… |
|
| 271 | 271 | curhdr->index = ctx->msgcount; |
| 272 | 272 | |
| 273 | | curhdr->env = mutt_read_rfc822_header (ctx->fp, curhdr); |
| | 273 | curhdr->env = mutt_read_rfc822_header (ctx->fp, curhdr, 0); |
| 274 | 274 | |
| 275 | 275 | /* if we know how long this message is, either just skip over the body, |
-
|
r437
|
r456
|
|
| 133 | 133 | { |
| 134 | 134 | h = mutt_new_header(); |
| 135 | | h->env = mutt_read_rfc822_header (f, h); |
| | 135 | h->env = mutt_read_rfc822_header (f, h, 0); |
| 136 | 136 | |
| 137 | 137 | fstat (fileno (f), &st); |
-
|
r453
|
r456
|
|
| 424 | 424 | parent->hdr = mutt_new_header (); |
| 425 | 425 | parent->hdr->offset = ftell (fp); |
| 426 | | parent->hdr->env = mutt_read_rfc822_header (fp, parent->hdr); |
| | 426 | parent->hdr->env = mutt_read_rfc822_header (fp, parent->hdr, 0); |
| 427 | 427 | msg = parent->hdr->content; |
| 428 | 428 | |
| … |
… |
|
| 836 | 836 | * f stream to read from |
| 837 | 837 | * |
| 838 | | * hdr header structure of current message (optional). If hdr is |
| 839 | | * NULL, then we are reading a postponed message, or called |
| 840 | | * from mutt_edit_headers() so we should keep a list of the |
| 841 | | * user-defined headers. |
| | 838 | * hdr header structure of current message (optional). |
| | 839 | * |
| | 840 | * user_hdrs If set, store user headers. Used for edit-message and |
| | 841 | * postpone modes. |
| | 842 | * |
| 842 | 843 | */ |
| 843 | | ENVELOPE *mutt_read_rfc822_header (FILE *f, HEADER *hdr) |
| | 844 | ENVELOPE *mutt_read_rfc822_header (FILE *f, HEADER *hdr, short user_hdrs) |
| 844 | 845 | { |
| 845 | 846 | ENVELOPE *e = mutt_new_envelope(); |
| … |
… |
|
| 1157 | 1158 | |
| 1158 | 1159 | /* Keep track of the user-defined headers */ |
| 1159 | | if (!matched) |
| | 1160 | if (!matched && user_hdrs) |
| 1160 | 1161 | { |
| 1161 | 1162 | if (last) |
-
|
r437
|
r456
|
|
| 1 | 1 | /* $Id$ */ |
| | 2 | |
| | 3 | /* XXX this file duplicates content from protos.h */ |
| | 4 | |
| 2 | 5 | BODY *mutt_parse_multipart (FILE *, const char *, long, int); |
| 3 | 6 | BODY *mutt_parse_messageRFC822 (FILE *, BODY *); |
| 4 | 7 | BODY *mutt_read_mime_header (FILE *, int); |
| 5 | 8 | |
| 6 | | ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *); |
| | 9 | ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *, short); |
| 7 | 10 | |
| 8 | 11 | time_t is_from (const char *, char *, size_t); |
-
|
r455
|
r456
|
|
| 7 | 7 | msgstr "" |
| 8 | 8 | "Project-Id-Version: PACKAGE VERSION\n" |
| 9 | | "POT-Creation-Date: 1998-10-15 00:54+0200\n" |
| | 9 | "POT-Creation-Date: 1998-10-15 03:08+0200\n" |
| 10 | 10 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
| 11 | 11 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
| … |
… |
|
| 2761 | 2761 | msgstr "" |
| 2762 | 2762 | |
| 2763 | | #: sendlib.c:1694 |
| | 2763 | #: sendlib.c:1695 |
| 2764 | 2764 | #, c-format |
| 2765 | 2765 | msgid "Error sending message, child exited %d (%s).\n" |
| 2766 | 2766 | msgstr "" |
| 2767 | 2767 | |
| 2768 | | #: sendlib.c:1696 |
| | 2768 | #: sendlib.c:1697 |
| 2769 | 2769 | #, c-format |
| 2770 | 2770 | msgid "Saved output of child process to %s.\n" |
| 2771 | 2771 | msgstr "" |
| 2772 | 2772 | |
| 2773 | | #: sendlib.c:1700 |
| | 2773 | #: sendlib.c:1701 |
| 2774 | 2774 | msgid "Error sending message." |
| 2775 | 2775 | msgstr "" |
-
|
r437
|
r456
|
|
| 381 | 381 | |
| 382 | 382 | fseek (msg->fp, hdr->offset, 0); |
| 383 | | newhdr->env = mutt_read_rfc822_header (msg->fp, newhdr); |
| | 383 | newhdr->env = mutt_read_rfc822_header (msg->fp, newhdr, 1); |
| 384 | 384 | |
| 385 | 385 | if (hdr->content->type == TYPEMESSAGE || hdr->content->type == TYPEMULTIPART) |
-
|
r437
|
r456
|
|
| 88 | 88 | BODY *mutt_read_mime_header (FILE *, int); |
| 89 | 89 | |
| 90 | | ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *); |
| | 90 | ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *, short); |
| 91 | 91 | HEADER *mutt_dup_header (HEADER *); |
| 92 | 92 | |
-
|
r453
|
r456
|
|
| 1025 | 1025 | body->hdr = mutt_new_header(); |
| 1026 | 1026 | body->hdr->offset = 0; |
| 1027 | | body->hdr->env = mutt_read_rfc822_header(fp, body->hdr); |
| | 1027 | /* we don't need the user headers here */ |
| | 1028 | body->hdr->env = mutt_read_rfc822_header(fp, body->hdr, 0); |
| 1028 | 1029 | #ifdef _PGPPATH |
| 1029 | 1030 | body->hdr->pgp = pgp; |