X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fmessage.c;h=b8a3ca4ac634122c11c3fe01217114c09c644160;hp=1ea30c96ac9f73bf0b5162988b579d248ad8c945;hb=388148b48fedd8007192a5f94cf0bad89c65227b;hpb=3766db5f849cea008b1cd3d532c712aeb17aa062 diff --git a/imap/message.c b/imap/message.c index 1ea30c9..b8a3ca4 100644 --- a/imap/message.c +++ b/imap/message.c @@ -54,11 +54,11 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend) int rc, mfhrc, oldmsgcount; int fetchlast = 0; const char *want_headers = - "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES string_list_t-POST X-LABEL"; + "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL"; #ifdef USE_HCACHE - void *hc = NULL; - unsigned long *uid_validity = NULL; + hcache_t *hc = NULL; + long *uid_validity = NULL; char uid_buf[64]; #endif /* USE_HCACHE */ @@ -83,7 +83,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend) /* instead of downloading all headers and then parsing them, we parse them * as they come in. */ - fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL); + fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL); if (!fp) { mutt_error(_("Could not create temporary file")); mutt_sleep(2); @@ -132,11 +132,10 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend) fputs ("\n\n", fp); sprintf (uid_buf, "/%u", h.data->uid); /* XXX --tg 21:41 04-07-11 */ - uid_validity = - (unsigned long *) mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen); + uid_validity = mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen); if (uid_validity != NULL && *uid_validity == idata->uid_validity) { - ctx->hdrs[msgno] = mutt_hcache_restore((unsigned char *) uid_validity, 0); + ctx->hdrs[msgno] = mutt_hcache_restore(uid_validity, 0); ctx->hdrs[msgno]->index = h.sid - 1; /* messages which have not been expunged are ACTIVE (borrowed from mh * folders) */ @@ -163,8 +162,8 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend) if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK))) { imap_free_header_data((void *)&h.data); - fclose (fp); - mutt_hcache_close (hc); + m_fclose(&fp); + mutt_hcache_close (&hc); return -1; } } @@ -262,9 +261,9 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend) if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK))) { imap_free_header_data ((void *)&h.data); - fclose (fp); + m_fclose(&fp); #ifdef USE_HCACHE - mutt_hcache_close (hc); + mutt_hcache_close (&hc); #endif /* USE_HCACHE */ return -1; } @@ -280,10 +279,10 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend) } #ifdef USE_HCACHE - mutt_hcache_close (hc); + mutt_hcache_close (&hc); #endif /* USE_HCACHE */ - fclose (fp); + m_fclose(&fp); if (ctx->msgcount > oldmsgcount) mx_update_context (ctx, ctx->msgcount - oldmsgcount); @@ -376,7 +375,7 @@ int imap_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) mutt_message _("Fetching message..."); cache->uid = HEADER_DATA (h)->uid; - msg->fp = m_tempfile(path, sizeof(path), NONULL(Tempdir), NULL); + msg->fp = m_tempfile(path, sizeof(path), NONULL(MCore.tmpdir), NULL); if (!msg->fp) { return -1; } @@ -574,7 +573,7 @@ int imap_append_message (CONTEXT * ctx, MESSAGE * msg) pc = imap_next_word (pc); mutt_error ("%s", pc); mutt_sleep (1); - fclose (fp); + m_fclose(&fp); goto fail; } @@ -595,7 +594,7 @@ int imap_append_message (CONTEXT * ctx, MESSAGE * msg) flush_buffer (buf, &len, idata->conn); mutt_socket_write (idata->conn, "\r\n"); - fclose (fp); + m_fclose(&fp); do rc = imap_cmd_step (idata); @@ -969,7 +968,7 @@ static int msg_has_flag (string_list_t * flag_list, const char *flag) /* msg_parse_fetch: handle headers returned from header fetch */ static int msg_parse_fetch (IMAP_HEADER * h, char *s) { - char tmp[SHORT_STRING]; + char tmp[STRING]; char *ptmp; if (!s)