commit 328d680acc729bea02652472996d658d62e38861
Author: Oswald Buddenhagen <o...@kde.org>
Date:   Sun Sep 16 12:34:07 2012 +0200

    try harder to list all necessary boxes
    
    the pattern "INB*" may or may not refer to something in the INBOX. even
    just "*" may. so list both the INBOX and the Path in case of
    uncertainty.

 src/main.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 0370125..5e8bb49 100644
--- a/src/main.c
+++ b/src/main.c
@@ -702,8 +702,26 @@ store_opened( store_t *ctx, void *aux )
        if (!mvars->skip && !mvars->boxlist && mvars->chan->patterns && 
!ctx->listed) {
                for (flags = 0, cpat = mvars->chan->patterns; cpat; cpat = 
cpat->next) {
                        const char *pat = cpat->string;
-                       if (*pat != '!')
-                               flags |= (!memcmp( pat, "INBOX", 5 ) && 
(!pat[5] || pat[5] == '/')) ? LIST_INBOX : LIST_PATH;
+                       if (*pat != '!') {
+                               int i;
+                               char c;
+                               static const char strinbox[] = "INBOX";
+                               for (i = 0; ; i++) {
+                                       c = pat[i];
+                                       if (i == sizeof(strinbox) - 1)
+                                               break;
+                                       if (c != strinbox[i])
+                                               goto nextpat;
+                               }
+                               if (!c || c == '/') {
+                                       flags |= LIST_INBOX;
+                               } else {
+                                 nextpat:
+                                       flags |= LIST_PATH;
+                                       if (c == '*' || c == '%')
+                                               flags |= LIST_INBOX;
+                               }
+                       }
                }
                set_bad_callback( ctx, store_bad, AUX );
                mvars->drv[t]->list( ctx, flags, store_listed, AUX );

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to