diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-03-02 03:14:52 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-03-02 03:14:52 +0000 |
commit | 715f09f5bc8a68aa7e7b645017410aad72f3bfaa (patch) | |
tree | 244e002d2a7f7196ff4e2f073a1f47522670ba34 | |
parent | 889f31a6e7359cfdeb63b9065a8e9a0a6683dde1 (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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | libsylph/imap.c | 16 |
3 files changed, 22 insertions, 4 deletions
@@ -1,3 +1,8 @@ +2006-03-02 + + * libsylph/imap.c: imap_rename_folder_real(): fixed crash when tried + to move folders right under the root folder. + 2006-03-01 * src/alertpanel.c: place dialog center if it is out of range (fixes diff --git a/ChangeLog.ja b/ChangeLog.ja index 535ea4fe..ac9ab30b 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,8 @@ +2006-03-02 + + * libsylph/imap.c: imap_rename_folder_real(): フォルダをルートフォルダ + 直下に移動しようとするとクラッシュするのを修正。 + 2006-03-01 * src/alertpanel.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_; } |