The program "mail" seems to process the -f option incorrectly.
In a call
  mail -f path name
or
  mail name
    (with "-f path" coming from /etc/mailutils.rc ":mail -f path")
the name is interpreted as another mailbox path and the
stored path is overwritten and lost.

The reason seems to be an incorrect use of the argp interface
in the function parse_opt.

The hack is even noted in the source:
<       /* People often tend to separate -f option from its argument
<        with a whitespace. This heuristics tries to catch the
<        error: */

It catches the error but produces another one.

The option "-f" induces an now-comes-file-name-argument-mode that
is not cleared when the argument actually comes. But this doesn't
allow for a proper handling of a missing argument anyway.

It seems much simpler to just pop the next parameter from the argp
interface that provides a "state->next" for that purpose.

--
Helmut Leitner    [EMAIL PROTECTED]
Graz, Austria   www.hls-software.com



_______________________________________________
Bug-mailutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-mailutils

Reply via email to