Skip to content

Commit

Permalink
Maildir: Call top-level directory '', not '.'
Browse files Browse the repository at this point in the history
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 <Sebastian@SSpaeth.de>
  • Loading branch information
spaetz committed Sep 19, 2011
1 parent 792243c commit a279aa7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions offlineimap/repository/Maildir.py
Expand Up @@ -146,7 +146,7 @@ def _getfolders_scandir(self, root, extension = None):
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']:
Expand All @@ -173,7 +173,7 @@ def _getfolders_scandir(self, root, extension = None):
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" % \
Expand Down

0 comments on commit a279aa7

Please sign in to comment.