Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Got rid of some unneeded externs.
[rsync/rsync.git]
/
exclude.c
diff --git
a/exclude.c
b/exclude.c
index
5cb274b
..
a261860
100644
(file)
--- a/
exclude.c
+++ b/
exclude.c
@@
-7,8
+7,9
@@
* Copyright (C) 2003-2007 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* Copyright (C) 2003-2007 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-16,8
+17,7
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ * with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
*/
#include "rsync.h"
@@
-144,9
+144,8
@@
static void add_rule(struct filter_list_struct *listp, const char *pat,
}
}
}
}
- if (!(ret = new(struct filter_struct)))
+ if (!(ret = new
0
(struct filter_struct)))
out_of_memory("add_rule");
out_of_memory("add_rule");
- memset(ret, 0, sizeof ret[0]);
if (!(mflags & (MATCHFLG_ABS_PATH | MATCHFLG_MERGE_FILE))
&& ((xflags & (XFLG_ANCHORED2ABS|XFLG_ABS_IF_SLASH) && *pat == '/')
if (!(mflags & (MATCHFLG_ABS_PATH | MATCHFLG_MERGE_FILE))
&& ((xflags & (XFLG_ANCHORED2ABS|XFLG_ABS_IF_SLASH) && *pat == '/')
@@
-494,25
+493,29
@@
void pop_local_filters(void *mem)
void change_local_filter_dir(const char *dname, int dlen, int dir_depth)
{
void change_local_filter_dir(const char *dname, int dlen, int dir_depth)
{
- static int
min_depth = MAXPATHLEN,
cur_depth = -1;
+ static int cur_depth = -1;
static void *filt_array[MAXPATHLEN/2+1];
if (!dname) {
static void *filt_array[MAXPATHLEN/2+1];
if (!dname) {
- while (cur_depth >= min_depth)
- pop_local_filters(filt_array[cur_depth--]);
- min_depth = MAXPATHLEN;
- cur_depth = -1;
+ for ( ; cur_depth >= 0; cur_depth--) {
+ if (filt_array[cur_depth]) {
+ pop_local_filters(filt_array[cur_depth]);
+ filt_array[cur_depth] = NULL;
+ }
+ }
return;
}
assert(dir_depth < MAXPATHLEN/2+1);
return;
}
assert(dir_depth < MAXPATHLEN/2+1);
- while (cur_depth >= dir_depth && cur_depth >= min_depth)
- pop_local_filters(filt_array[cur_depth--]);
- cur_depth = dir_depth;
- if (cur_depth < min_depth)
- min_depth = cur_depth;
+ for ( ; cur_depth >= dir_depth; cur_depth--) {
+ if (filt_array[cur_depth]) {
+ pop_local_filters(filt_array[cur_depth]);
+ filt_array[cur_depth] = NULL;
+ }
+ }
+ cur_depth = dir_depth;
filt_array[cur_depth] = push_local_filters(dname, dlen);
}
filt_array[cur_depth] = push_local_filters(dname, dlen);
}