aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-vee-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-vee-store.c')
-rw-r--r--camel/camel-vee-store.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
index 72bde97413..e909671e36 100644
--- a/camel/camel-vee-store.c
+++ b/camel/camel-vee-store.c
@@ -167,11 +167,19 @@ static void
build_info(char *name, CamelVeeFolder *folder, struct _build_info *data)
{
CamelFolderInfo *info;
+ int toplen, namelen;
+
+ namelen = strlen(name);
+ toplen = strlen(data->top);
/* check we have to include this one */
if (data->top) {
if (data->flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) {
- if (strncmp(name, data->top, strlen(data->top) != 0))
+ if (!((namelen == toplen &&
+ strcmp(name, data->top) == 0)
+ || ((namelen > toplen)
+ && strncmp(name, data->top, toplen) == 0
+ && name[toplen] == '/')))
return;
} else {
if (strcmp(name, data->top))