Commit 8eb0b629 authored by Leah Neukirchen's avatar Leah Neukirchen

replace GNU-extension tdestroy(3) with something portable

parent c9c4a157
......@@ -2080,9 +2080,13 @@ tree_recurse(const void *nodep, const VISIT which, const int depth)
}
void
tree_free(void *nodep)
tree_free()
{
free_fi(nodep);
while (root) {
struct fileinfo *fi = *(struct fileinfo **)root;
tdelete(fi, &root, order);
free_fi(fi);
}
}
int
......@@ -2267,7 +2271,7 @@ main(int argc, char *argv[])
while (root) {
twalk(root, tree_print);
twalk(root, tree_recurse);
tdestroy(root, tree_free);
tree_free();
root = new_root;
new_root = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment