Re: Little code cleanup
On 2008-03-03 08:40:36 +0100, Sébastien Hinderer wrote:
> ../hg/compose.c: In function 'mutt_compose_menu':
> ../hg/compose.c:1210: warning: the address of 'fname' will always evaluate as
> 'true'
> ../hg/mx.c: In function 'mx_close_mailbox':
> ../hg/mx.c:859: warning: the address of 'mbox' will always evaluate as 'true'
>
> The patch below fixes them.
>
> Sébastien.
From a quick look, the warnings are actually mistaken, and the patch
shouldn't be applied.
> diff -r 9a7d802004d3 compose.c
> --- a/compose.c Sun Mar 02 21:45:53 2008 -0800
> +++ b/compose.c Mon Mar 03 08:35:48 2008 +0100
> @@ -1207,7 +1207,7 @@ int mutt_compose_menu (HEADER *msg, /*
> if (msg->content->next)
> msg->content = mutt_make_multipart (msg->content);
>
> - if (mutt_write_fcc (NONULL (fname), msg, NULL, 1, NULL) < 0)
> + if (mutt_write_fcc (fname, msg, NULL, 1, NULL) < 0)
> msg->content = mutt_remove_multipart (msg->content);
> else
> mutt_message _("Message written.");
> diff -r 9a7d802004d3 mx.c
> --- a/mx.c Sun Mar 02 21:45:53 2008 -0800
> +++ b/mx.c Mon Mar 03 08:35:48 2008 +0100
> @@ -856,7 +856,7 @@ int mx_close_mailbox (CONTEXT *ctx, int
> isSpool = mutt_is_spool (ctx->path) && !mutt_is_spool (mbox);
> }
>
> - if (isSpool && mbox && *mbox)
> + if (isSpool && *mbox)
> {
> mutt_expand_path (mbox, sizeof (mbox));
> snprintf (buf, sizeof (buf), _("Move read messages to %s?"), mbox);
>
>
--
Thomas Roessler <roessler@xxxxxxxxxxxxxxxxxx>