From c6e8df106b860b5b99c0e91055453e1f67fe834d Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 30 Jan 2004 04:37:28 +0000 Subject: copy the old_name that comes in, since it might be the actual folder_name, 2004-01-30 Not Zed * camel-store.c (camel_store_rename_folder): copy the old_name that comes in, since it might be the actual folder_name, which will go away during processing. Related to #53123. svn path=/trunk/; revision=24532 --- camel/ChangeLog | 6 ++++++ camel/camel-store.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index b828328a7d..3753da6f32 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2004-01-30 Not Zed + + * camel-store.c (camel_store_rename_folder): copy the old_name + that comes in, since it might be the actual folder_name, which + will go away during processing. Related to #53123. + 2004-01-29 Not Zed ** See bug #53269. diff --git a/camel/camel-store.c b/camel/camel-store.c index d547a93d19..c1a63e7582 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -368,17 +368,20 @@ rename_folder (CamelStore *store, const char *old_name, const char *new_name, Ca * Rename a named folder to a new name. **/ void -camel_store_rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex) +camel_store_rename_folder (CamelStore *store, const char *old_namein, const char *new_name, CamelException *ex) { CamelFolder *folder; int i, oldlen, namelen; GPtrArray *folders; + char *old_name; d(printf("store rename folder %s '%s' '%s'\n", ((CamelService *)store)->url->protocol, old_name, new_name)); if (strcmp(old_name, new_name) == 0) return; + /* need to save this, since old_namein might be folder->full_name, which could go away */ + old_name = g_strdup(old_namein); oldlen = strlen(old_name); CAMEL_STORE_LOCK(store, folder_lock); @@ -449,6 +452,7 @@ camel_store_rename_folder (CamelStore *store, const char *old_name, const char * CAMEL_STORE_UNLOCK(store, folder_lock); g_ptr_array_free(folders, TRUE); + g_free(old_name); } -- cgit v1.2.3