aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-store.c
diff options
context:
space:
mode:
author9 <NotZed@Ximian.com>2001-10-29 13:06:59 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-29 13:06:59 +0800
commit8e598e640e9cbc8fe42d5d017b4557d656f24c5b (patch)
tree38b33360f334a12623d049b5ce364731e7c12830 /camel/camel-store.c
parentfedf164cb97afe53eab3e3e4fcfb1765e89a61b5 (diff)
downloadgsoc2013-evolution-8e598e640e9cbc8fe42d5d017b4557d656f24c5b.tar
gsoc2013-evolution-8e598e640e9cbc8fe42d5d017b4557d656f24c5b.tar.gz
gsoc2013-evolution-8e598e640e9cbc8fe42d5d017b4557d656f24c5b.tar.bz2
gsoc2013-evolution-8e598e640e9cbc8fe42d5d017b4557d656f24c5b.tar.lz
gsoc2013-evolution-8e598e640e9cbc8fe42d5d017b4557d656f24c5b.tar.xz
gsoc2013-evolution-8e598e640e9cbc8fe42d5d017b4557d656f24c5b.tar.zst
gsoc2013-evolution-8e598e640e9cbc8fe42d5d017b4557d656f24c5b.zip
Fix the 'is this a matching subfolder or subfolder'' logic to match
2001-10-29 <NotZed@Ximian.com> * camel-vee-store.c (build_info): Fix the 'is this a matching subfolder or subfolder'' logic to match camel-store get_subfolders'. * camel-store.c (get_subfolders): Fix the 'is this a matching folder or subfolder' logic. svn path=/trunk/; revision=14324
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r--camel/camel-store.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c
index a8c6b79bf0..d98df75d55 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -383,8 +383,17 @@ struct _get_info {
static void
get_subfolders(char *key, CamelFolder *folder, struct _get_info *info)
{
- /* If this is a subfolder of the one to be renamed, we need to get it, AND lock it */
- if (strncmp(folder->full_name, info->old, strlen(info->old)) == 0) {
+ int oldlen, namelen;
+
+ namelen = strlen(folder->full_name);
+ oldlen = strlen(info->old);
+
+ if ((namelen == oldlen &&
+ strcmp(folder->full_name, info->old) == 0)
+ || ((namelen > oldlen)
+ && strncmp(folder->full_name, info->old, oldlen) == 0
+ && folder->full_name[oldlen] == info->store->dir_sep)) {
+
d(printf("Found subfolder of '%s' == '%s'\n", info->old, folder->full_name));
camel_object_ref((CamelObject *)folder);
g_ptr_array_add(info->folders, folder);