diff options
Diffstat (limited to 'mail/tag.c')
-rw-r--r-- | mail/tag.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/mail/tag.c b/mail/tag.c index d93f9df87..77a5c8f6f 100644 --- a/mail/tag.c +++ b/mail/tag.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999-2019 Free Software Foundation, Inc. + Copyright (C) 1999-2024 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ /* unt[ag] [msglist] */ static int -tag_message (mu_message_t mesg, msgset_t *msgset MU_ARG_UNUSED, void *arg) +tag_message (msgset_t *msgset, mu_message_t mesg, void *arg) { mu_attribute_t attr; int *action = arg; @@ -36,14 +36,8 @@ tag_message (mu_message_t mesg, msgset_t *msgset MU_ARG_UNUSED, void *arg) int mail_tag (int argc, char **argv) { - msgset_t *msgset; int action = argv[0][0] != 'u'; - - if (msgset_parse (argc, argv, MSG_NODELETED|MSG_SILENT, &msgset)) - return 1; - - util_msgset_iterate (msgset, tag_message, (void *)&action); - - msgset_free (msgset); - return 0; + + return util_foreach_msg (argc, argv, MSG_NODELETED|MSG_SILENT, + tag_message, &action); } |