dav/main.c

changeset 24
a317202ae787
parent 22
e593f7e41be0
child 26
146171b57e69
--- a/dav/main.c	Mon Aug 19 14:45:53 2013 +0200
+++ b/dav/main.c	Mon Aug 19 17:10:22 2013 +0200
@@ -591,9 +591,14 @@
     }
     
     DavResource *res = dav_query(sn, "get - from %s", path);
+    sn->error = DAV_NOT_FOUND;
     if(!res) {
-        if(sn->error = DAV_NOT_FOUND) {
+        if(sn->error == DAV_NOT_FOUND) {
             res = dav_resource_new(sn, path);
+            if(dav_create(res)) {
+                fprintf(stderr, "Cannot create resource.\n");
+                return -1;
+            }
         } else {
             if(sn->errorstr) {
                 fprintf(stderr, "Error: %s\n", sn->errorstr);

mercurial