aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/local/camel-local-store.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-09-26 13:34:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-09-26 13:34:10 +0800
commita007d6d2084df436d5f1fa2b6804064c6e7c62e0 (patch)
treeb74d0961cc17c7935369ca6724785eaef1adce4b /camel/providers/local/camel-local-store.c
parente45b3e48281defcf3df2761b4bf3ce0c3b2d5357 (diff)
downloadgsoc2013-evolution-a007d6d2084df436d5f1fa2b6804064c6e7c62e0.tar.gz
gsoc2013-evolution-a007d6d2084df436d5f1fa2b6804064c6e7c62e0.tar.zst
gsoc2013-evolution-a007d6d2084df436d5f1fa2b6804064c6e7c62e0.zip
Implement FOLDER_CREATE flag. (scan_dir): Dont free name on exception, its
2002-09-26 Not Zed <NotZed@Ximian.com> * providers/local/camel-spool-store.c (get_folder): Implement FOLDER_CREATE flag. (scan_dir): Dont free name on exception, its alloca'd. (scan_dir): If we start scanning from a file, just add that directly. (scan_dir): Allow empty files to also show up in folder list, as well as files starting with "From ". * providers/local/camel-spool-folder.c (camel_spool_folder_new): Check folder != NULL before writing to it. * providers/local/camel-local-store.c (create_folder): Handle a parent of NULL for creating top-level dirs. Part of #31186. svn path=/trunk/; revision=18230
Diffstat (limited to 'camel/providers/local/camel-local-store.c')
-rw-r--r--camel/providers/local/camel-local-store.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index 0fbb9eb14e..567b2b316a 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -222,15 +222,16 @@ create_folder(CamelStore *store, const char *parent_name, const char *folder_nam
/* This is a pretty hacky version of create folder, but should basically work */
- /* FIXME: The strings here are funny because of string freeze */
-
if (path[0] != '/') {
camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
_("Store root %s is not an absolute path"), path);
return NULL;
}
- name = g_strdup_printf("%s/%s/%s", path, parent_name, folder_name);
+ if (parent_name)
+ name = g_strdup_printf("%s/%s/%s", path, parent_name, folder_name);
+ else
+ name = g_strdup_printf("%s/%s", path, folder_name);
if (stat(name, &st) == 0 || errno != ENOENT) {
camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
@@ -241,7 +242,10 @@ create_folder(CamelStore *store, const char *parent_name, const char *folder_nam
g_free(name);
- name = g_strdup_printf("%s/%s", parent_name, folder_name);
+ if (parent_name)
+ name = g_strdup_printf("%s/%s", parent_name, folder_name);
+ else
+ name = g_strdup_printf("%s", folder_name);
folder = ((CamelStoreClass *)((CamelObject *)store)->klass)->get_folder(store, name, CAMEL_STORE_FOLDER_CREATE, ex);
if (folder) {