diff options
author | Kevin McCarthy <kevin@8t8.us> | 2017-08-10 18:18:19 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2017-08-10 18:18:19 -0700 |
commit | 3433587a5a77ef94806236cbeb6181df71440928 (patch) | |
tree | 2dbfdc6bbe6cd6701eb24270a246b9a038fa906e /attach.c | |
parent | a19e52661bb5f4e6d34c803f469f6835c309e06a (diff) |
Change helpers functions to pass actx. (see #3728)
Change the pager, compose, recvattach and recvcmd to pass the actx
instead of the individual idx and idxlen parameters.
Separate out the compose menu exit logic to first free the BODY data
and then call the shared actx free function at the bottom.
Diffstat (limited to 'attach.c')
-rw-r--r-- | attach.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -330,7 +330,7 @@ void mutt_check_lookup_list (BODY *b, char *type, int len) /* returns -1 on error, 0 or the return code from mutt_do_pager() on success */ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, - ATTACHPTR **idx, short idxlen) + ATTACH_CONTEXT *actx) { char tempfile[_POSIX_PATH_MAX] = ""; char pagerfile[_POSIX_PATH_MAX] = ""; @@ -571,8 +571,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, info.fp = fp; info.bdy = a; info.ctx = Context; - info.idx = idx; - info.idxlen = idxlen; + info.actx = actx; info.hdr = hdr; rc = mutt_do_pager (descrip, pagerfile, @@ -1046,7 +1045,12 @@ int mutt_print_attachment (FILE *fp, BODY *a) void mutt_free_attach_context (ATTACH_CONTEXT **pactx) { int i; - ATTACH_CONTEXT *actx = *pactx; + ATTACH_CONTEXT *actx; + + if (!pactx || !*pactx) + return; + + actx = *pactx; for (i = 0; i < actx->idxlen; i++) { |