"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "exclude.c" between
rsync-3.2.1.tar.gz and rsync-3.2.2.tar.gz

About: rsync is a fast incremental file-copying tool for bringing remote (and local) files into sync.

exclude.c  (rsync-3.2.1):exclude.c  (rsync-3.2.2)
skipping to change at line 25 skipping to change at line 25
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website. * with this program; if not, visit the http://fsf.org website.
*/ */
#include "rsync.h" #include "rsync.h"
#include "default-cvsignore.h" #include "default-cvsignore.h"
#include "ifuncs.h"
extern int am_server; extern int am_server;
extern int am_sender; extern int am_sender;
extern int eol_nulls; extern int eol_nulls;
extern int io_error; extern int io_error;
extern int local_server; extern int local_server;
extern int prune_empty_dirs; extern int prune_empty_dirs;
extern int ignore_perishable; extern int ignore_perishable;
extern int delete_mode; extern int delete_mode;
extern int delete_excluded; extern int delete_excluded;
skipping to change at line 203 skipping to change at line 204
pre_len = 0; pre_len = 0;
/* The daemon wants dir-exclude rules to get an appended "/" + "***". */ /* The daemon wants dir-exclude rules to get an appended "/" + "***". */
if (xflags & XFLG_DIR2WILD3 if (xflags & XFLG_DIR2WILD3
&& BITS_SETnUNSET(rule->rflags, FILTRULE_DIRECTORY, FILTRULE_INCLUDE)) { && BITS_SETnUNSET(rule->rflags, FILTRULE_DIRECTORY, FILTRULE_INCLUDE)) {
rule->rflags &= ~FILTRULE_DIRECTORY; rule->rflags &= ~FILTRULE_DIRECTORY;
suf_len = sizeof SLASH_WILD3_SUFFIX - 1; suf_len = sizeof SLASH_WILD3_SUFFIX - 1;
} else } else
suf_len = 0; suf_len = 0;
if (!(rule->pattern = new_array(char, pre_len + pat_len + suf_len + 1))) rule->pattern = new_array(char, pre_len + pat_len + suf_len + 1);
out_of_memory("add_rule");
if (pre_len) { if (pre_len) {
memcpy(rule->pattern, dirbuf + module_dirlen, pre_len); memcpy(rule->pattern, dirbuf + module_dirlen, pre_len);
for (cp = rule->pattern; cp < rule->pattern + pre_len; cp++) { for (cp = rule->pattern; cp < rule->pattern + pre_len; cp++) {
if (*cp == '/') if (*cp == '/')
slash_cnt++; slash_cnt++;
} }
} }
strlcpy(rule->pattern + pre_len, pat, pat_len + 1); strlcpy(rule->pattern + pre_len, pat, pat_len + 1);
pat_len += pre_len; pat_len += pre_len;
if (suf_len) { if (suf_len) {
skipping to change at line 265 skipping to change at line 265
s++; s++;
else else
s = ex->pattern; s = ex->pattern;
len = strlen(s); len = strlen(s);
if (len == pat_len - (cp - rule->pattern) && memcmp(s, cp , len) == 0) { if (len == pat_len - (cp - rule->pattern) && memcmp(s, cp , len) == 0) {
free_filter(rule); free_filter(rule);
return; return;
} }
} }
if (!(lp = new_array0(filter_rule_list, 1))) lp = new_array0(filter_rule_list, 1);
out_of_memory("add_rule");
if (asprintf(&lp->debug_type, " [per-dir %s]", cp) < 0) if (asprintf(&lp->debug_type, " [per-dir %s]", cp) < 0)
out_of_memory("add_rule"); out_of_memory("add_rule");
rule->u.mergelist = lp; rule->u.mergelist = lp;
if (mergelist_cnt == mergelist_size) { if (mergelist_cnt == mergelist_size) {
mergelist_size += 5; mergelist_size += 5;
mergelist_parents = realloc_array(mergelist_parents, mergelist_parents = realloc_array(mergelist_parents, filt
filter_rule *, er_rule *, mergelist_size);
mergelist_size);
if (!mergelist_parents)
out_of_memory("add_rule");
} }
if (DEBUG_GTE(FILTER, 2)) { if (DEBUG_GTE(FILTER, 2)) {
rprintf(FINFO, "[%s] activating mergelist #%d%s\n", rprintf(FINFO, "[%s] activating mergelist #%d%s\n",
who_am_i(), mergelist_cnt, lp->debug_type); who_am_i(), mergelist_cnt, lp->debug_type);
} }
mergelist_parents[mergelist_cnt++] = rule; mergelist_parents[mergelist_cnt++] = rule;
} else } else
rule->u.slash_cnt = slash_cnt; rule->u.slash_cnt = slash_cnt;
if (!listp->tail) { if (!listp->tail) {
skipping to change at line 501 skipping to change at line 496
} }
if (!mergelist_cnt) { if (!mergelist_cnt) {
/* No old state to save and no new merge files to push. */ /* No old state to save and no new merge files to push. */
return NULL; return NULL;
} }
push = (struct local_filter_state *)new_array(char, push = (struct local_filter_state *)new_array(char,
sizeof (struct local_filter_state) sizeof (struct local_filter_state)
+ (mergelist_cnt-1) * sizeof (filter_rule_list)); + (mergelist_cnt-1) * sizeof (filter_rule_list));
if (!push)
out_of_memory("push_local_filters");
push->mergelist_cnt = mergelist_cnt; push->mergelist_cnt = mergelist_cnt;
for (i = 0; i < mergelist_cnt; i++) { for (i = 0; i < mergelist_cnt; i++) {
filter_rule *ex = mergelist_parents[i]; filter_rule *ex = mergelist_parents[i];
if (!ex) if (!ex)
continue; continue;
memcpy(&push->mergelists[i], ex->u.mergelist, sizeof (filter_rule _list)); memcpy(&push->mergelists[i], ex->u.mergelist, sizeof (filter_rule _list));
} }
/* Note: parse_filter_file() might increase mergelist_cnt, so keep /* Note: parse_filter_file() might increase mergelist_cnt, so keep
skipping to change at line 825 skipping to change at line 818
if (template->rflags & FILTRULE_WORD_SPLIT) { if (template->rflags & FILTRULE_WORD_SPLIT) {
/* Skip over any initial whitespace. */ /* Skip over any initial whitespace. */
while (isspace(*s)) while (isspace(*s))
s++; s++;
/* Update to point to real start of rule. */ /* Update to point to real start of rule. */
*rulestr_ptr = (const char *)s; *rulestr_ptr = (const char *)s;
} }
if (!*s) if (!*s)
return NULL; return NULL;
if (!(rule = new0(filter_rule))) rule = new0(filter_rule);
out_of_memory("parse_rule_tok");
/* Inherit from the template. Don't inherit FILTRULES_SIDES; we check /* Inherit from the template. Don't inherit FILTRULES_SIDES; we check
* that later. */ * that later. */
rule->rflags = template->rflags & FILTRULES_FROM_CONTAINER; rule->rflags = template->rflags & FILTRULES_FROM_CONTAINER;
/* Figure out what kind of a filter rule "s" is pointing at. Note /* Figure out what kind of a filter rule "s" is pointing at. Note
* that if FILTRULE_NO_PREFIXES is set, the rule is either an include * that if FILTRULE_NO_PREFIXES is set, the rule is either an include
* or an exclude based on the inheritance of the FILTRULE_INCLUDE * or an exclude based on the inheritance of the FILTRULE_INCLUDE
* flag (above). XFLG_OLD_PREFIXES indicates a compatibility mode * flag (above). XFLG_OLD_PREFIXES indicates a compatibility mode
* for old include/exclude patterns where just "+ " and "- " are * for old include/exclude patterns where just "+ " and "- " are
skipping to change at line 1128 skipping to change at line 1120
if (new_rflags & FILTRULE_MERGE_FILE) { if (new_rflags & FILTRULE_MERGE_FILE) {
if (!pat_len) { if (!pat_len) {
pat = ".cvsignore"; pat = ".cvsignore";
pat_len = 10; pat_len = 10;
} }
if (new_rflags & FILTRULE_EXCLUDE_SELF) { if (new_rflags & FILTRULE_EXCLUDE_SELF) {
const char *name; const char *name;
filter_rule *excl_self; filter_rule *excl_self;
if (!(excl_self = new0(filter_rule))) excl_self = new0(filter_rule);
out_of_memory("parse_filter_str");
/* Find the beginning of the basename and add an exclude for it. */ /* Find the beginning of the basename and add an exclude for it. */
for (name = pat + pat_len; name > pat && name[-1] != '/'; name--) {} for (name = pat + pat_len; name > pat && name[-1] != '/'; name--) {}
add_rule(listp, name, (pat + pat_len) - name, exc l_self, 0); add_rule(listp, name, (pat + pat_len) - name, exc l_self, 0);
rule->rflags &= ~FILTRULE_EXCLUDE_SELF; rule->rflags &= ~FILTRULE_EXCLUDE_SELF;
} }
if (new_rflags & FILTRULE_PERDIR_MERGE) { if (new_rflags & FILTRULE_PERDIR_MERGE) {
if (parent_dirscan) { if (parent_dirscan) {
const char *p; const char *p;
unsigned int len = pat_len; unsigned int len = pat_len;
if ((p = parse_merge_name(pat, &len, modu le_dirlen))) if ((p = parse_merge_name(pat, &len, modu le_dirlen)))
 End of changes. 7 change blocks. 
15 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)