Skip to content
  • Kevin J. McCarthy's avatar
    Tighten $query_command parsing to allow empty name field. · b022931d
    Kevin J. McCarthy authored
    The documentation writes the output should be "each line containing a
    tab separated address then name then some other optional information".
    The wiki page at
    <https://gitlab.com/muttmua/mutt/-/wikis/MuttGuide/Aliases> also
    implies a single tab between each field.
    
    Since the function used strtok, consecutive tab delimeters were
    treated as a single delimiter.  This caused a missing name field to
    use the comment field as the name.
    
    Change the function to use strchr instead.  This is not without risk,
    as the functionality is old.  Who knows what all programs have been
    written that might assume initial, or multiple delimiters are
    acceptable...
    
    Thanks to Magnus Groß for reporting the problem along with a patch,
    which this commit is derived from.
    b022931d