fixed dav get with -u option

Wed, 23 Mar 2016 13:46:39 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 23 Mar 2016 13:46:39 +0100
changeset 235
0468df02e18f
parent 234
33f373b28c8c
child 236
6b4ce32d0c4e

fixed dav get with -u option

dav/main.c file | annotate | diff | comparison | revisions
dav/sync.c file | annotate | diff | comparison | revisions
libidav/davqlexec.c file | annotate | diff | comparison | revisions
--- a/dav/main.c	Tue Mar 22 15:40:34 2016 +0100
+++ b/dav/main.c	Wed Mar 23 13:46:39 2016 +0100
@@ -611,7 +611,7 @@
     for(int i=0;i<2;i++) {
         res = dav_query(
                 sn,
-                "select - from %s with depth = %d where lastmodified > %t",
+                "select - from %s with depth = %d where iscollection or lastmodified > %t",
                 path,
                 depth,
                 t);
@@ -628,10 +628,8 @@
         return -1;
     }
     if(!recursive && res->iscollection) {
-        char *res_url = util_concat_path(sn->base_url, path);
-        fprintf(stderr, "Resource %s is a collection.\n", res_url);
+        fprintf(stderr, "Resource %s is a collection.\n", res->path);
         fprintf(stderr, "Use the -R option to download collections.\n");
-        free(res_url);
         return -1;
     }
     
@@ -664,9 +662,7 @@
     size_t outlen = strlen(out);
     // print some status message in recursive mode
     if(cmd_getoption(a, "recursive")) {
-        char *res_url = util_concat_path(res->session->base_url, res->path);
-        printf("get: %s\n", res_url);
-        free(res_url);
+        printf("get: %s\n", res->path);
     }
     
     if(res->iscollection) {
--- a/dav/sync.c	Tue Mar 22 15:40:34 2016 +0100
+++ b/dav/sync.c	Wed Mar 23 13:46:39 2016 +0100
@@ -77,6 +77,8 @@
     if(!strcasecmp(cmd, "version") || !strcasecmp(cmd, "-version") || !strcasecmp(cmd, "--version")) {
         fprintf(stderr, "dav-sync %s\n", DAV_VERSION);
         loadcfg = 0;
+        cmd_args_free(args);
+        return -1;
     }
     
     if(loadcfg) {
--- a/libidav/davqlexec.c	Tue Mar 22 15:40:34 2016 +0100
+++ b/libidav/davqlexec.c	Wed Mar 23 13:46:39 2016 +0100
@@ -1142,8 +1142,9 @@
             }
             case DAVQL_CMD_OP_LOGICAL_OR_L: {
                 //printf("or_l %d\n", cmd.data.integer);
-                DavQLStackObj obj1 = DAVQL_POP();
+                DavQLStackObj obj1 = stack[stpos];
                 if((obj1.type == 0 && obj1.data.integer) || (obj1.type == 1 && obj1.data.string)) {
+                    stpos--;
                     DAVQL_PUSH_INT(1);
                     i += cmd.data.integer; // jump, skip right subtree of 'or'
                 }

mercurial