]> code.delx.au - offlineimap/commitdiff
/offlineimap/head: changeset 293
authorjgoerzen <jgoerzen>
Fri, 3 Jan 2003 02:05:14 +0000 (03:05 +0100)
committerjgoerzen <jgoerzen>
Fri, 3 Jan 2003 02:05:14 +0000 (03:05 +0100)
Now properly handles folder names that contain parenthesis. Used patch
from Kyler Laird in http://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=173895. Closes: #173895.

offlineimap/head/debian/changelog
offlineimap/head/offlineimap/imaputil.py

index 2cd1a7ea136e90f57a615492c93a491cd6196c2e..69bf0763ade633e3d1435eeba2c7b5bc0b962423 100644 (file)
@@ -1,6 +1,10 @@
 offlineimap (3.99.6) unstable; urgency=low
 
   * Beginnings of work to make it work with a threaded Tcl/Tk Tkinter.
+  * Now properly handles folder names that contain parenthesis.  Used
+    patch from Kyler Laird in
+    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=173895.
+    Closes: #173895.   
 
  -- John Goerzen <jgoerzen@complete.org>  Thu,  2 Jan 2003 13:59:44 -0600
 
index e906b2996023d909f1276752c270bc397220bff5..b533daf61a10747fa0da8ff71bd7fe88689f4033 100644 (file)
@@ -112,8 +112,14 @@ def imapsplit(imapstring):
     retval = []
     while len(workstr):
         if workstr[0] == '(':
-            # Needs rindex to properly process eg (FLAGS () UID 123)
-            rpareni = workstr.rindex(')') + 1
+            rparenc = 1 # count of right parenthesis to match
+            rpareni = 1 # position to examine
+           while rparenc: # Find the end of the group.
+               if workstr[rpareni] == ')':  # end of a group
+                       rparenc -= 1
+               elif workstr[rpareni] == '(':  # start of a group
+                       rparenc += 1
+               rpareni += 1  # Move to next character.
             parenlist = workstr[0:rpareni]
             workstr = workstr[rpareni:].lstrip()
             retval.append(parenlist)