diff options
| author | Vincent Richard <[email protected]> | 2005-07-23 13:14:21 +0000 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2005-07-23 13:14:21 +0000 |
| commit | 81b7b009e9562323efb277d8fd4cc48675b35dc7 (patch) | |
| tree | fea343bca2ee4f528663930ade76844f7055d312 /src/messaging/maildir/maildirFolder.cpp | |
| parent | Fixed a bug when destroying an unconnected IMAP service. (diff) | |
| download | vmime-81b7b009e9562323efb277d8fd4cc48675b35dc7.tar.gz vmime-81b7b009e9562323efb277d8fd4cc48675b35dc7.zip | |
Fixed getMessages().
Diffstat (limited to 'src/messaging/maildir/maildirFolder.cpp')
| -rw-r--r-- | src/messaging/maildir/maildirFolder.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/messaging/maildir/maildirFolder.cpp b/src/messaging/maildir/maildirFolder.cpp index d24ab5e5..ebb0dd29 100644 --- a/src/messaging/maildir/maildirFolder.cpp +++ b/src/messaging/maildir/maildirFolder.cpp @@ -405,12 +405,16 @@ ref <message> maildirFolder::getMessage(const int num) std::vector <ref <message> > maildirFolder::getMessages(const int from, const int to) { + const int to2 = (to == -1 ? m_messageCount : to); + if (!isOpen()) throw exceptions::illegal_state("Folder not open"); + else if (to2 < from || from < 1 || to2 < 1 || from > m_messageCount || to2 > m_messageCount) + throw exceptions::message_not_found(); std::vector <ref <message> > v; - for (int i = from ; i <= to ; ++i) + for (int i = from ; i <= to2 ; ++i) { v.push_back(vmime::create <maildirMessage> (thisWeakRef().dynamicCast <maildirFolder>(), i)); |
