2140 lspath = util_parent_path(path); |
2140 lspath = util_parent_path(path); |
2141 filter = sstr(util_resource_name(path)); |
2141 filter = sstr(util_resource_name(path)); |
2142 } |
2142 } |
2143 |
2143 |
2144 DavResource *ls = dav_query(sn, "select - from %s order by name", lspath); |
2144 DavResource *ls = dav_query(sn, "select - from %s order by name", lspath); |
2145 DavResource *elm = ls->children; |
2145 DavResource *elm = ls ? ls->children : NULL; |
2146 while(elm) { |
2146 while(elm) { |
2147 sstr_t name = sstr(elm->name); |
2147 sstr_t name = sstr(elm->name); |
2148 if(sstrprefix(name, filter)) { |
2148 if(sstrprefix(name, filter)) { |
2149 int space = 0; |
2149 int space = 0; |
2150 for(int i=0;i<name.length;i++) { |
2150 for(int i=0;i<name.length;i++) { |