[Pkg-owncloud-commits] [owncloud-client] 40/218: Fix the Windows build

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 17 14:30:39 UTC 2015


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 35318ea9b51d6447158527f99e6a4fcbd23d5366
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Mon Aug 31 17:23:15 2015 +0200

    Fix the Windows build
    
    Use an iterator variable declared outside of the loop condition
    expression.
    
    MinGW doesn't support C99 very easily and it's easier to keep
    our C code C89 compliant.
---
 csync/src/csync_exclude.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/csync/src/csync_exclude.c b/csync/src/csync_exclude.c
index d5cee43..c673aff 100644
--- a/csync/src/csync_exclude.c
+++ b/csync/src/csync_exclude.c
@@ -268,23 +268,23 @@ static CSYNC_EXCLUDE_TYPE _csync_excluded_common(c_strlist_t *excludes, const ch
     c_strlist_t *path_components = c_strlist_new(32);
     char *path_split = strdup(path);
     size_t len = strlen(path_split);
-    for (int j = len; ; --j) {
+    for (i = len; ; --i) {
         // read backwards until a path separator is found
-        if (j != 0 && path_split[j-1] != '/') {
+        if (i != 0 && path_split[i-1] != '/') {
             continue;
         }
 
         // check 'basename', i.e. for "/foo/bar/fi" we'd check 'fi', 'bar', 'foo'
-        if (path_split[j] != 0) {
-            c_strlist_add_grow(&path_components, path_split + j);
+        if (path_split[i] != 0) {
+            c_strlist_add_grow(&path_components, path_split + i);
         }
 
-        if (j == 0 || !check_leading_dirs) {
+        if (i == 0 || !check_leading_dirs) {
             break;
         }
 
         // check 'dirname', i.e. for "/foo/bar/fi" we'd check '/foo/bar', '/foo'
-        path_split[j-1] = '\0';
+        path_split[i-1] = '\0';
         c_strlist_add_grow(&path_components, path_split);
     }
     SAFE_FREE(path_split);

-- 
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