<<< Date Index >>>     <<< Thread Index >>>

Re: [Mutt] #3097: mutt's multi-file -a handling fails for



#3097: mutt's multi-file -a handling fails for POSIX-compliant getopt()
---------------------+------------------------------------------------------
  Reporter:  jhawk   |       Owner:  mutt-dev                  
      Type:  defect  |      Status:  new                       
  Priority:  minor   |   Milestone:  1.6                       
 Component:  mutt    |     Version:  1.5.17                    
Resolution:          |    Keywords:  attachment -a posix getopt
---------------------+------------------------------------------------------

Comment(by agriffis):

 I'm not sure we should switch to POSIXLY_CORRECT parsing by default.  It
 prevents this common usage from working:

 {{{
 mutt addr1 addr2 -s "subject"
 }}}

 The current behavior is actually broken even with GNU getopt.  For
 example:

 {{{
 mutt addr1 -a file           # works
 mutt addr1 -a file -- addr2  # fails with "addr1: unable to attach file."
 }}}

 I suppose this is a silly example but it shows that right now it's not
 robust.  Maybe the best answer would be to force GNU getopt (include it
 with mutt for compatibility with non-GNU systems) and use "-" at the start
 of options rather than "+".  That would give mutt the flexibility to
 handle options correctly.

 Patch attached, though it doesn't augment the configure checks nor does it
 embed GNU getopt, this is just proof-of-concept.

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/3097#comment:2>
Mutt <http://www.mutt.org/>
The Mutt mail user agent