From: Klaas Freitag Date: Mon, 20 Jun 2016 13:50:20 +0000 (+0200) Subject: excludes: Only log if the pattern was really logged. (#4989) X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1150^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=191177ff22b3fec7e8213bf7c9d0e3be2e0540a9;p=nextcloud-desktop.git excludes: Only log if the pattern was really logged. (#4989) --- diff --git a/csync/src/csync_exclude.c b/csync/src/csync_exclude.c index bad25f8d2..d432781ba 100644 --- a/csync/src/csync_exclude.c +++ b/csync/src/csync_exclude.c @@ -52,7 +52,7 @@ int _csync_exclude_add(c_strlist_t **inList, const char *string) { for (i = 0; i < (*inList)->count; ++i) { char *pattern = (*inList)->vector[i]; if (c_streq(pattern, string)) { - return 0; + return 1; } } } @@ -151,8 +151,10 @@ int csync_exclude_load(const char *fname, c_strlist_t **list) { buf[i] = '\0'; if (*entry != '#') { const char *unescaped = csync_exclude_expand_escapes(entry); - CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Adding entry: %s", unescaped); rc = _csync_exclude_add(list, unescaped); + if( rc == 0 ) { + CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Adding entry: %s", unescaped); + } SAFE_FREE(unescaped); if (rc < 0) { goto out;