/*
* 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
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) {
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;