From a279aa7307ca036f93b660ade84099550ff1a4f2 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Mon, 19 Sep 2011 14:14:44 +0200 Subject: [PATCH] Maildir: Call top-level directory '', not '.' If nametrans translates to an empty directory we want to find the top-level directory by name '' and not by name '.'. This unbreaks nametrans rules that result in empty folder names. Signed-off-by: Sebastian Spaeth --- offlineimap/repository/Maildir.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/offlineimap/repository/Maildir.py b/offlineimap/repository/Maildir.py index 637969f..afdfb76 100644 --- a/offlineimap/repository/Maildir.py +++ b/offlineimap/repository/Maildir.py @@ -146,7 +146,7 @@ class MaildirRepository(BaseRepository): self.debug(" toppath = %s" % toppath) # Iterate over directories in top & top itself. - for dirname in os.listdir(toppath) + ['.']: + for dirname in os.listdir(toppath) + ['']: self.debug(" *** top of loop") self.debug(" dirname = %s" % dirname) if dirname in ['cur', 'new', 'tmp']: @@ -173,7 +173,7 @@ class MaildirRepository(BaseRepository): foldername, self.getsep(), self)) - if self.getsep() == '/' and dirname != '.': + if self.getsep() == '/' and dirname != '': # Recursively check sub-directories for folders too. retval.extend(self._getfolders_scandir(root, foldername)) self.debug("_GETFOLDERS_SCANDIR RETURNING %s" % \