fixes dav put output

Thu, 03 Aug 2017 12:48:28 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 03 Aug 2017 12:48:28 +0200
changeset 271
7b1ca53f3897
parent 270
0edfb4c0e7f8
child 272
b321a3be0a38

fixes dav put output

print mkcol: instead of put: for directories

dav/main.c file | annotate | diff | comparison | revisions
--- a/dav/main.c	Thu Aug 03 12:31:17 2017 +0200
+++ b/dav/main.c	Thu Aug 03 12:48:28 2017 +0200
@@ -790,9 +790,6 @@
 
 int put_entry(Repository *repo, CmdArgs *a, DavSession *sn, char *path, char *file,  DavBool root) {
     int recursive = cmd_getoption(a, "recursive") ? 1 : 0;
-    if(recursive && !root) {
-        printf("put: %s\n", file);
-    }
     struct stat s;
     if(stat(file, &s)) {
         perror("stat");
@@ -809,6 +806,11 @@
                     file);
             return 1;
         }
+        
+        if(!root) {
+            printf("mkcol: %s\n", file);
+        }
+        
         DIR *dir = opendir(file);
         if(!dir) {
             // error
@@ -846,6 +848,10 @@
             dav_resource_free(res);
         }
     } else if(S_ISREG(s.st_mode)) {
+        if(recursive) {
+            printf("put: %s\n", file);
+        }
+        
         /*
          * use stdin if the input file is -
          */

mercurial