dav/main.c

changeset 70
88092b88ec00
parent 68
f6d3db6113d3
child 72
aac29f2e8030
equal deleted inserted replaced
69:0dbdd7e8c1fc 70:88092b88ec00
219 Repository *repo = get_repository(r); 219 Repository *repo = get_repository(r);
220 if(repo) { 220 if(repo) {
221 *path = sstrdup(p).ptr; 221 *path = sstrdup(p).ptr;
222 } else { 222 } else {
223 repo = calloc(1, sizeof(Repository)); 223 repo = calloc(1, sizeof(Repository));
224 repo->name = ""; 224 repo->name = strdup("");
225 repo->url = strdup(url);
226 repo->decrypt_content = true; 225 repo->decrypt_content = true;
227 *path = strdup("/"); 226 if(url[ulen-1] == '/') {
227 repo->url = strdup(url);
228 *path = strdup("/");
229 } else {
230 repo->url = util_parent_path(url);
231 // TODO: check/fix
232 *path = strdup(util_resource_name(url)-1);
233 }
228 } 234 }
229 235
230 return repo; 236 return repo;
231 } 237 }
232 238

mercurial