Skip to content

Commit

Permalink
Don't append trailing slash to maildir foldernames
Browse files Browse the repository at this point in the history
When sep='/' in a Maildir, we were doing a os.path.join(dirname,'') on
the top level maildir, which results in a "dirname/", so all our maildir
folder names had slashes appended. Which is pretty much wrong, so this
fixes it by only using os.path.join when we actually have something to
append.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
  • Loading branch information
spaetz committed Dec 1, 2011
1 parent 464342e commit 3bc68ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions offlineimap/repository/Maildir.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _getfolders_scandir(self, root, extension = None):
# Not a directory -- not a folder.
continue
foldername = dirname
if extension != None:
if extension and dirname != '':
foldername = os.path.join(extension, dirname)
if (os.path.isdir(os.path.join(fullname, 'cur')) and
os.path.isdir(os.path.join(fullname, 'new')) and
Expand All @@ -187,7 +187,7 @@ def _getfolders_scandir(self, root, extension = None):
self.debug("_GETFOLDERS_SCANDIR RETURNING %s" % \
repr([x.getname() for x in retval]))
return retval

def getfolders(self):
if self.folders == None:
self.folders = self._getfolders_scandir(self.root)
Expand Down

0 comments on commit 3bc68ec

Please sign in to comment.