diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-05 13:45:42 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-05 13:45:42 +0000 |
commit | 268030e3a835a8251b83fc0b27b5f7080ca7b288 (patch) | |
tree | 5e2a067056c8e517e5931ad0cd38c7818accfa5f | |
parent | b481b31ede6b8fe148d7c13423be6f2e371031f0 (diff) | |
download | mailutils-268030e3a835a8251b83fc0b27b5f7080ca7b288.tar.gz mailutils-268030e3a835a8251b83fc0b27b5f7080ca7b288.tar.bz2 |
(util_get_message): Expanded semantics of the last
argument. It now contains flags that control how
util_get_message operates. Flags are a bitwise sum of the
following:
MSG_ALL Return any message (deleted or not)
MSG_NODELETED Do not return deleted messages.
MSG_SILENT Do not output warnings about deleted
messages.
-rw-r--r-- | mail/util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mail/util.c b/mail/util.c index d7e976fe2..2422e3ea9 100644 --- a/mail/util.c +++ b/mail/util.c @@ -1225,7 +1225,7 @@ util_header_expand (header_t *phdr) } int -util_get_message (mailbox_t mbox, size_t msgno, message_t *msg, int delflag) +util_get_message (mailbox_t mbox, size_t msgno, message_t *msg, int flag) { int status; @@ -1243,9 +1243,11 @@ util_get_message (mailbox_t mbox, size_t msgno, message_t *msg, int delflag) return status; } - if (delflag && util_isdeleted (*msg)) + if ((flag & MSG_NODELETED) && util_isdeleted (*msg)) { - util_error ("%d: Inappropriate message (has been deleted)"); + if (!(flag & MSG_SILENT)) + util_error ("%lu: Inappropriate message (has been deleted)", + (unsigned long) msgno); return ENOENT; } return 0; |