Fix a segfault if we don't find an exlcude list.

This commit is contained in:
Andreas Schneider 2008-04-30 16:36:54 +02:00
parent 25e300c462
commit 5a2fa7f563

View file

@ -104,6 +104,10 @@ void csync_exclude_destroy(CSYNC *ctx) {
int csync_excluded(CSYNC *ctx, const char *path) { int csync_excluded(CSYNC *ctx, const char *path) {
size_t i; size_t i;
if (ctx->excludes == NULL) {
return 0;
}
if (ctx->excludes->count) { if (ctx->excludes->count) {
for (i = 0; i < ctx->excludes->count; i++) { for (i = 0; i < ctx->excludes->count; i++) {
if (fnmatch(ctx->excludes->vector[i], path, 0) == 0) { if (fnmatch(ctx->excludes->vector[i], path, 0) == 0) {