Fri, 02 Oct 2015 13:29:32 +0200
fixed order by
libidav/resource.c | file | annotate | diff | comparison | revisions |
--- a/libidav/resource.c Fri Oct 02 13:18:17 2015 +0200 +++ b/libidav/resource.c Fri Oct 02 13:29:32 2015 +0200 @@ -367,7 +367,7 @@ } } - if(r < 0 || !resource->next) { + if(r < 0) { // insert child before resource child->prev = resource->prev; child->next = resource; @@ -378,6 +378,12 @@ } resource->prev = child; break; + } if(!resource->next) { + // append child + child->prev = resource; + child->next = NULL; + resource->next = child; + break; } else { resource = resource->next; }