source multiple files at once - Cedric Duval (cd) diff -r 488554e28d5f init.c --- a/init.c Thu Feb 10 12:38:56 2011 +0100 +++ b/init.c Thu Feb 10 12:39:30 2011 +0100 @@ -2346,20 +2346,24 @@ static int parse_source (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) { char path[_POSIX_PATH_MAX]; - - if (mutt_extract_token (tmp, s, 0) != 0) + int rc = 0; + + do { - snprintf (err->data, err->dsize, _("source: error at %s"), s->dptr); - return (-1); + if (mutt_extract_token (tmp, s, 0) != 0) + { + snprintf (err->data, err->dsize, _("source: error at %s"), s->dptr); + return (-1); + } + + strfcpy (path, tmp->data, sizeof (path)); + mutt_expand_path (path, sizeof (path)); + + rc += source_rc (path, err); } - if (MoreArgs (s)) - { - strfcpy (err->data, _("source: too many arguments"), err->dsize); - return (-1); - } - strfcpy (path, tmp->data, sizeof (path)); - mutt_expand_path (path, sizeof (path)); - return (source_rc (path, err)); + while (MoreArgs (s)); + + return ((rc < 0) ? -1 : 0); } /* line command to execute