[Pkg-owncloud-commits] [owncloud-client] 127/332: Permission: keep a space if the permission is empty

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Aug 14 21:06:49 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 9c0a21a5fbe36a6f783977de1767fbdc754fc480
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Tue Jun 24 10:52:42 2014 +0200

    Permission: keep a space if the permission is empty
    
    To distinguish no permission present to nothing is allowed.
    That was the intention of the old code but it did not work as
    the first if was always taken
---
 csync/src/csync_owncloud_util.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/csync/src/csync_owncloud_util.c b/csync/src/csync_owncloud_util.c
index 1e84ca8..1a07a28 100644
--- a/csync/src/csync_owncloud_util.c
+++ b/csync/src/csync_owncloud_util.c
@@ -373,15 +373,15 @@ void fill_webdav_properties_into_resource(struct resource* newres, const ne_prop
     if (directDownloadCookies) {
         newres->directDownloadCookies = c_strdup(directDownloadCookies);
     }
-    if (perm && strlen(perm) < sizeof(newres->remotePerm)) {
-        strncpy(newres->remotePerm, perm, sizeof(newres->remotePerm));
-    } else if (perm && strlen(perm) == 0) {
+    if (perm && !perm[0]) {
         // special meaning for our code: server returned permissions but are empty
         // meaning only reading is allowed for this resource
         newres->remotePerm[0] = ' ';
         // see _csync_detect_update()
+    } else if (perm && strlen(perm) < sizeof(newres->remotePerm)) {
+        strncpy(newres->remotePerm, perm, sizeof(newres->remotePerm));
     } else {
-        // old server, keep NULL in newres->remotePerm
+        // old server, keep newres->remotePerm empty
     }
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list