From 715f09f5bc8a68aa7e7b645017410aad72f3bfaa Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 2 Mar 2006 03:14:52 +0000 Subject: 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 --- libsylph/imap.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'libsylph/imap.c') 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_; } -- cgit v1.2.3