#3785: adding an attachment failed with success
---------------------+----------------------
Reporter: vinc17 | Owner: mutt-dev
Type: defect | Status: new
Priority: major | Milestone:
Component: mutt | Version: 1.5.24
Resolution: | Keywords:
---------------------+----------------------
Comment (by kevin8t8):
Hi Vincent,
Is this repeatable at all, or a one-time failure (so far)? When you tried
to attach the file, did you use the file browser, or just type in the name
of the file?
It looks like the error message was generated by mutt_perror(). I've
looked through the OP_COMPOSE_ATTACH_FILE call path and haven't seen any
calls to mutt_perror().
However, I do see calls to mutt_perror() in the OP_COMPOSE_ATTACH_MESSAGE
call path. Is it possible you accidentally hit "A" instead of "a"?
Going on that assumption, I still see things that should be fixed:
{{{
ctx = mx_open_mailbox (fname, M_READONLY, NULL);
if (ctx == NULL)
{
mutt_perror (fname);
break;
}
}}}
errno isn't necessarily set if mx_open_mailbox returns NULL, so the call
to mutt_perror() isn't correct.
Inside mx_open_mailbox(), if there is a problem getting the "magic" value
then mutt_perror/mutt_error() are called, but not once the code actually
tries (and fails) to open the correct mailbox type.
So it looks like the call to mutt_perror() above should be changed to
something like mutt_error(_("Unable to open mailbox %s")) instead.
In any case, please let me know if you think you might have hit "A", or if
you can duplicate this with "a".
Thank you,
-Kevin
--
Ticket URL: <http://dev.mutt.org/trac/ticket/3785#comment:1>
Mutt <http://www.mutt.org/>
The Mutt mail user agent