2009-03-03 [colin] 3.7.0cvs77
authorColin Leroy <colin@colino.net>
Tue, 3 Mar 2009 17:25:11 +0000 (17:25 +0000)
committerColin Leroy <colin@colino.net>
Tue, 3 Mar 2009 17:25:11 +0000 (17:25 +0000)
* src/prefs_filtering.c
Win32: Fix bug 1865, 'IMAP account name changes
are not followed at filter actions'

ChangeLog
PATCHSETS
configure.ac
src/prefs_filtering.c

index 8426c99..08396c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-03 [colin]     3.7.0cvs77
+
+       * src/prefs_filtering.c
+               Win32: Fix bug 1865, 'IMAP account name changes 
+               are not followed at filter actions'
+
 2009-03-02 [colin]     3.7.0cvs76
 
        * src/imap.c
index 3448633..d974180 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.23 -r 1.1.2.24 src/printing.c;  ) > 3.7.0cvs74.patchset
 ( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 manual/es/account.xml;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 manual/es/ack.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/es/addrbook.xml;  cvs diff -u -r 1.1.2.14 -r 1.1.2.15 manual/es/advanced.xml;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/es/claws-mail-manual.xml;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 manual/es/faq.xml;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 manual/es/glossary.xml;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 manual/es/gpl.xml;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 manual/es/handling.xml;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 manual/es/intro.xml;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 manual/es/keyboard.xml;  cvs diff -u -r 1.1.2.6 -r 1.1.2.7 manual/es/plugins.xml;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 manual/es/starting.xml;  cvs diff -u -r 1.60.2.56 -r 1.60.2.57 po/es.po;  ) > 3.7.0cvs75.patchset
 ( cvs diff -u -r 1.179.2.243 -r 1.179.2.244 src/imap.c;  ) > 3.7.0cvs76.patchset
+( cvs diff -u -r 1.59.2.78 -r 1.59.2.79 src/prefs_filtering.c;  ) > 3.7.0cvs77.patchset
index a86a249..5c7c442 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=76
+EXTRA_VERSION=77
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 4c1ec60..b3d840b 100644 (file)
@@ -653,9 +653,13 @@ static void rename_path(GSList * filters,
        gint oldpathlen;
         GSList * action_cur;
         GSList * cur;
-
+       const gchar *separator=G_DIR_SEPARATOR_S;
+       gboolean matched = FALSE;
+#ifdef G_OS_WIN32
+again:
+#endif
        oldpathlen = strlen(old_path);
-       old_path_with_sep = g_strconcat(old_path,G_DIR_SEPARATOR_S,NULL);
+       old_path_with_sep = g_strconcat(old_path,separator,NULL);
 
        for (cur = filters; cur != NULL; cur = cur->next) {
                FilteringProp   *filtering = (FilteringProp *)cur->data;
@@ -685,28 +689,30 @@ static void rename_path(GSList * filters,
                                         while (*base == G_DIR_SEPARATOR) base++;
                                         if (*base == '\0')
                                                 dest_path = g_strconcat(prefix,
-                                                    G_DIR_SEPARATOR_S,
+                                                    separator,
                                                     new_path, NULL);
                                         else
                                                 dest_path = g_strconcat(prefix,
-                                                    G_DIR_SEPARATOR_S,
+                                                    separator,
                                                     new_path,
-                                                    G_DIR_SEPARATOR_S,
+                                                    separator,
                                                     base, NULL);
                                         
                                         g_free(prefix);
                                         g_free(action->destination);
                                         action->destination = dest_path;
+                                       matched = TRUE;
                                 } else { /* for non-leaf folders */
                                         /* compare with trailing slash */
                                         if (!strncmp(old_path_with_sep, action->destination, oldpathlen+1)) {
                                                 
                                                 suffix = action->destination + oldpathlen + 1;
                                                 dest_path = g_strconcat(new_path,
-                                                    G_DIR_SEPARATOR_S,
+                                                    separator,
                                                     suffix, NULL);
                                                 g_free(action->destination);
                                                 action->destination = dest_path;
+                                               matched = TRUE;
                                         }
                                 }
                         } else {
@@ -715,10 +721,19 @@ static void rename_path(GSList * filters,
                                         dest_path = g_strdup(new_path);
                                         g_free(action->destination);
                                         action->destination = dest_path;
+                                       matched = TRUE;
                                 }
                         }
                 }
         }
+       
+       g_free(old_path_with_sep);
+#ifdef G_OS_WIN32
+       if (!strcmp(separator, G_DIR_SEPARATOR_S) && !matched) {
+               separator = "/";
+               goto again;
+       }
+#endif
 }
 
 static gboolean prefs_filtering_rename_path_func(GNode *node, gpointer data)