exclude: Simplify the csync_excluded() loop.

Thanks to Klaas Freitag.
This commit is contained in:
Andreas Schneider 2012-10-22 15:32:28 +02:00
parent e43466d09d
commit 14f03e0ebb

View file

@ -163,19 +163,15 @@ int csync_excluded(CSYNC *ctx, const char *path) {
goto out;
}
if (ctx->excludes->count) {
for (i = 0; i < ctx->excludes->count; i++) {
for (i = 0; match == 0 && i < ctx->excludes->count; i++) {
rc = csync_fnmatch(ctx->excludes->vector[i], path, 0);
if (rc == 0) {
match = 1;
goto out;
}
rc = csync_fnmatch(ctx->excludes->vector[i], bname, 0);
if (rc == 0) {
match = 1;
goto out;
}
}
}