Re: [PATCH] Fix <get-attachment> to use $tmpdraftdir.

Rene Kita <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <[email protected]>
On Mon, Aug 24, 2026 at 03:05:39PM +0800, Kevin J. McCarthy wrote:
> I missed converting it before because it was hidden inside a shared
> function, mutt_rfc1524_expand_filename().  Most of those callers use
> the file for an actual $tmpdir file, but <get-attachment> should put
> it in the compose $tmpdraftdir like other attachments.
> 
> Add a parameter to select the $tmpdraftdir and modify
> mutt_get_tmp_attachment() to set the parameter when calling.
> ---
>  attach.c  | 11 ++++++-----
>  handler.c |  2 +-
>  rfc1524.c |  8 ++++++--
>  rfc1524.h |  2 +-
>  4 files changed, 14 insertions(+), 9 deletions(-)
> 
[...]
> diff --git a/rfc1524.h b/rfc1524.h
> index e74feb37..7d0f2426 100644
> --- a/rfc1524.h
> +++ b/rfc1524.h
> @@ -37,7 +37,7 @@ typedef struct rfc1524_mailcap_entry {
>  rfc1524_entry *rfc1524_new_entry(void);
>  void rfc1524_free_entry(rfc1524_entry **);
>  int mutt_rfc1524_expand_command(BODY *, const char *, const char *, BUFFER *);
> -void mutt_rfc1524_expand_filename(const char *, const char *, BUFFER *);
> +void mutt_rfc1524_expand_filename(const char *, const char *, BUFFER *, int);
>  int rfc1524_mailcap_lookup(BODY *, char *, size_t, rfc1524_entry *, int);
>  int mutt_rename_file(const char *, const char *);

I don't like this. I'd would add a new function, e.g.
mutt_rfc1524_expand_draftname and wrap the original functionality inside
a static _mutt_rfc1524_expand_filename. Dealing with such flag
parameters tends to get ugly over time.

Of course, names are up to discussion. :-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.