diff --git a/src/csync_misc.c b/src/csync_misc.c index 2654060ae1..96ab122f75 100644 --- a/src/csync_misc.c +++ b/src/csync_misc.c @@ -264,7 +264,6 @@ CSYNC_STATUS csync_errno_to_status(int error, CSYNC_STATUS default_status) /* Remove possible quotes, and also the -gzip at the end * Remove "-gzip" at the end (cf. https://github.com/owncloud/mirall/issues/1195) * The caller must take ownership of the resulting string. - * (work in place) */ char *csync_normalize_etag(const char *etag) { diff --git a/src/csync_owncloud.c b/src/csync_owncloud.c index d30cc7fc35..6243323a2a 100644 --- a/src/csync_owncloud.c +++ b/src/csync_owncloud.c @@ -621,13 +621,7 @@ static void results(void *userdata, } if( md5sum ) { - int len = strlen(md5sum)-2; - if( len > 0 ) { - /* Skip the " around the string coming back from the ne_propset_value call */ - newres->md5 = c_malloc(len+1); - strncpy( newres->md5, md5sum+1, len ); - newres->md5[len] = '\0'; - } + newres->md5 = csync_normalize_etag(md5sum); } csync_vio_set_file_id(newres->file_id, file_id); diff --git a/src/csync_owncloud_recursive_propfind.c b/src/csync_owncloud_recursive_propfind.c index cb4741d5f2..4522fc3a1d 100644 --- a/src/csync_owncloud_recursive_propfind.c +++ b/src/csync_owncloud_recursive_propfind.c @@ -185,13 +185,7 @@ static void propfind_results_recursive(void *userdata, } if( md5sum ) { - int len = strlen(md5sum)-2; - if( len > 0 ) { - /* Skip the " around the string coming back from the ne_propset_value call */ - newres->md5 = c_malloc(len+1); - strncpy( newres->md5, md5sum+1, len ); - newres->md5[len] = '\0'; - } + newres->md5 = csync_normalize_etag(md5sum); } csync_vio_set_file_id(newres->file_id, file_id); diff --git a/src/csync_statedb.c b/src/csync_statedb.c index 63fe615492..5df2bd517e 100644 --- a/src/csync_statedb.c +++ b/src/csync_statedb.c @@ -550,8 +550,7 @@ char *csync_statedb_get_uniqId( CSYNC *ctx, uint64_t jHash, csync_vio_file_stat_ } if (result->count == 2) { - /* phash, pathlen, path, inode, uid, gid, mode, modtime */ - ret = c_strdup( result->vector[0] ); + ret = csync_normalize_etag( result->vector[0] ); csync_vio_file_stat_set_file_id(buf, result->vector[1]); }