1 Fixed unexpected removal of a directory if it is moved into itself: return
2 EINVAL in this situation. It also happens when trying to change directory name
4 Picked from upstream svn r337.
6 ===================================================================
7 --- libexfat/node.c.orig 2013-01-25 22:09:06.197124362 +0100
8 +++ libexfat/node.c 2013-01-25 22:11:41.273118704 +0100
10 exfat_put_node(ef, node);
14 + /* check that target is not a subdirectory of the source */
15 + if (node->flags & EXFAT_ATTRIB_DIR)
17 + struct exfat_node* p;
19 + for (p = dir; p; p = p->parent)
22 + if (existing != NULL)
23 + exfat_put_node(ef, existing);
24 + exfat_put_node(ef, dir);
25 + exfat_put_node(ef, node);
32 /* remove target if it's not the same node as source */