dav/main.c

changeset 70
88092b88ec00
parent 68
f6d3db6113d3
child 72
aac29f2e8030
--- a/dav/main.c	Fri Dec 12 15:48:54 2014 +0100
+++ b/dav/main.c	Mon Dec 15 09:57:35 2014 +0100
@@ -221,10 +221,16 @@
         *path = sstrdup(p).ptr;
     } else {
         repo = calloc(1, sizeof(Repository));
-        repo->name = "";
-        repo->url = strdup(url);
+        repo->name = strdup("");
         repo->decrypt_content = true;
-        *path = strdup("/");
+        if(url[ulen-1] == '/') {
+            repo->url = strdup(url);
+            *path = strdup("/");
+        } else {
+            repo->url = util_parent_path(url);
+            // TODO: check/fix
+            *path = strdup(util_resource_name(url)-1);
+        }
     }
     
     return repo;

mercurial