107 fprintf(stderr, " -c Disable conflict detection\n"); |
107 fprintf(stderr, " -c Disable conflict detection\n"); |
108 fprintf(stderr, " -r Read changes from stdin\n\n"); |
108 fprintf(stderr, " -r Read changes from stdin\n\n"); |
109 } |
109 } |
110 |
110 |
111 static int res_matches_filter(SyncDirectory *dir, char *res_path) { |
111 static int res_matches_filter(SyncDirectory *dir, char *res_path) { |
112 |
|
113 UCX_FOREACH(inc, dir->include) { |
112 UCX_FOREACH(inc, dir->include) { |
114 regex_t* pattern = (regex_t*) inc->data; |
113 regex_t* pattern = (regex_t*) inc->data; |
115 if (regexec(pattern, res_path, 0, NULL, 0)) { |
114 if (regexec(pattern, res_path, 0, NULL, 0) == 0) { |
116 return 1; |
115 UCX_FOREACH(exc, dir->exclude) { |
117 } |
116 regex_t* pattern = (regex_t*) exc->data; |
118 } |
117 if (regexec(pattern, res_path, 0, NULL, 0) == 0) { |
119 |
118 return 1; |
120 UCX_FOREACH(exc, dir->exclude) { |
119 } |
121 regex_t* pattern = (regex_t*) exc->data; |
120 } |
122 if (!regexec(pattern, res_path, 0, NULL, 0)) { |
121 return 0; |
123 return 1; |
122 } |
124 } |
123 } |
125 } |
124 return 1; |
126 |
|
127 return 0; |
|
128 } |
125 } |
129 |
126 |
130 int cmd_pull(CmdArgs *a) { |
127 int cmd_pull(CmdArgs *a) { |
131 if(a->argc != 1) { |
128 if(a->argc != 1) { |
132 fprintf(stderr, "Too %s arguments\n", a->argc < 1 ? "few" : "many"); |
129 fprintf(stderr, "Too %s arguments\n", a->argc < 1 ? "few" : "many"); |