struct mail_storage *storage;
const char *root_dir, *inbox_dir, *index_dir, *control_dir;
const char *home, *path, *p;
+ size_t len;
inbox_dir = root_dir = index_dir = control_dir = NULL;
if (root_dir == NULL)
return NULL;
+ /* strip trailing '/' */
+ len = strlen(root_dir);
+ if (root_dir[len-1] == '/')
+ root_dir = t_strndup(root_dir, len-1);
+
if (index_dir == NULL)
index_dir = root_dir;
else if (strcmp(index_dir, "MEMORY") == 0)
root_dir = create_root_dir();
if (root_dir == NULL)
return NULL;
+ } else {
+ /* strip trailing '/' */
+ size_t len = strlen(root_dir);
+ if (root_dir[len-1] == '/')
+ root_dir = t_strndup(root_dir, len-1);
}
if (inbox_file == NULL)