2009-01-11 [colin] 3.7.0cvs30
[claws.git] / src / folder.c
index bd6e03554f564402604ece1d47c177023ee69b04..2a7c9320d047efac446787df26f10b904fac2e90 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2008 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -964,6 +964,8 @@ void folder_fast_scan_tree(Folder *folder)
 FolderItem *folder_create_folder(FolderItem *parent, const gchar *name)
 {
        FolderItem *new_item;
+       
+       g_return_val_if_fail(parent != NULL, NULL);
 
        new_item = parent->folder->klass->create_folder(parent->folder, parent, name);
        if (new_item) {
@@ -1322,14 +1324,10 @@ FolderItem *folder_find_child_item_by_name(FolderItem *item, const gchar *name)
        FolderItem *child;
 
        for (node = item->node->children; node != NULL; node = node->next) {
-               gchar *base;
                child = FOLDER_ITEM(node->data);
-               base = g_path_get_basename(child->path);
-               if (strcmp2(base, name) == 0) {
-                       g_free(base);
+               if (strcmp2(child->name, name) == 0) {
                        return child;
                }
-               g_free(base);
        }
 
        return NULL;