2139 } else { |
2139 } else { |
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", lspath); |
2144 DavResource *ls = dav_query(sn, "select - from %s order by name", lspath); |
2145 DavResource *elm = ls->children; |
2145 DavResource *elm = ls->children; |
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; |
2167 } |
2167 } |
2168 } else { |
2168 } else { |
2169 ucx_buffer_puts(out, elm->path); |
2169 ucx_buffer_puts(out, elm->path); |
2170 } |
2170 } |
2171 if(elm->iscollection) { |
2171 if(elm->iscollection) { |
2172 ucx_buffer_putc(out, '/'); |
2172 if(out->space[out->pos-1] != '/') { |
|
2173 ucx_buffer_putc(out, '/'); |
|
2174 } |
2173 } |
2175 } |
2174 printf("%.*s\n", (int)out->pos, out->space); |
2176 printf("%.*s\n", (int)out->pos, out->space); |
2175 |
2177 |
2176 ucx_buffer_free(out); |
2178 ucx_buffer_free(out); |
2177 } |
2179 } |