aboutsummaryrefslogtreecommitdiff
path: root/libsylph/imap.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-03-02 03:14:52 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-03-02 03:14:52 +0000
commit715f09f5bc8a68aa7e7b645017410aad72f3bfaa (patch)
tree244e002d2a7f7196ff4e2f073a1f47522670ba34 /libsylph/imap.c
parent889f31a6e7359cfdeb63b9065a8e9a0a6683dde1 (diff)
fixed crash when tried to move IMAP4 folders right under the root folder.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1020 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/imap.c')
-rw-r--r--libsylph/imap.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/libsylph/imap.c b/libsylph/imap.c
index 2d395044..353b05f2 100644
--- a/libsylph/imap.c
+++ b/libsylph/imap.c
@@ -2159,14 +2159,22 @@ static gint imap_rename_folder_real(Folder *folder, FolderItem *item,
separator = imap_get_path_separator(IMAP_FOLDER(folder), item->path);
if (new_parent) {
if (name) {
- newpath = g_strconcat(new_parent->path,
- G_DIR_SEPARATOR_S, name, NULL);
+ if (new_parent->path)
+ newpath = g_strconcat(new_parent->path,
+ G_DIR_SEPARATOR_S, name,
+ NULL);
+ else
+ newpath = g_strdup(name);
} else {
gchar *name_;
name_ = g_path_get_basename(item->path);
- newpath = g_strconcat(new_parent->path,
- G_DIR_SEPARATOR_S, name_, NULL);
+ if (new_parent->path)
+ newpath = g_strconcat(new_parent->path,
+ G_DIR_SEPARATOR_S, name_,
+ NULL);
+ else
+ newpath = g_strdup(name_);
AUTORELEASE_STR(name_, );
name = name_;
}