diff options
author | Vincent Richard <[email protected]> | 2004-12-22 11:01:17 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2004-12-22 11:01:17 +0000 |
commit | a4251085d24e870104e1b3bf76c66ba71a69a78b (patch) | |
tree | ca878fe9d1f418724a8a20c09e2ee84e6297021a /src/messaging/maildirStore.cpp | |
parent | Notify direct and indirect sub-folders when renaming an IMAP folder. (diff) | |
download | vmime-a4251085d24e870104e1b3bf76c66ba71a69a78b.tar.gz vmime-a4251085d24e870104e1b3bf76c66ba71a69a78b.zip |
Done rename() operation on 'maildir' + fixed some bugs/limitations in maildir/IMAP.
Diffstat (limited to 'src/messaging/maildirStore.cpp')
-rw-r--r-- | src/messaging/maildirStore.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/messaging/maildirStore.cpp b/src/messaging/maildirStore.cpp index 2f737622..3434321f 100644 --- a/src/messaging/maildirStore.cpp +++ b/src/messaging/maildirStore.cpp @@ -77,9 +77,23 @@ folder* maildirStore::getFolder(const folder::path& path) const bool maildirStore::isValidFolderName(const folder::path::component& name) { - return (platformDependant::getHandler()-> - getFileSystemFactory()->isValidPathComponent(name) && - name.getBuffer().find_first_of(".") == string::npos); + if (!platformDependant::getHandler()->getFileSystemFactory()->isValidPathComponent(name)) + return false; + + const string& buf = name.getBuffer(); + + // Name cannot start/end with spaces + if (stringUtils::trim(buf) != name.getBuffer()) + return false; + + // Name cannot start with '.' + const int length = buf.length(); + int pos = 0; + + while ((pos < length) && (buf[pos] == '.')) + ++pos; + + return (pos == 0); } |