mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-25 23:28:17 -04:00
Updated the exclude-list code to handle the new linked-list
structure format.
This commit is contained in:
1 parent
495723bb26
commit
bf6dcd1713
4 files changed
+21
-25
No files matched your search
@@ -64,9 +64,9 @@ extern int sanitize_paths;
|
||||
extern int read_batch;
|
||||
extern int write_batch;
|
||||
|
||||
extern struct exclude_struct **exclude_list;
|
||||
extern struct exclude_struct **server_exclude_list;
|
||||
extern struct exclude_struct **local_exclude_list;
|
||||
extern struct exclude_list_struct exclude_list;
|
||||
extern struct exclude_list_struct server_exclude_list;
|
||||
extern struct exclude_list_struct local_exclude_list;
|
||||
|
||||
int io_error;
|
||||
|
||||
@@ -226,18 +226,18 @@ static int check_exclude_file(char *fname, int is_dir, int exclude_level)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (server_exclude_list
|
||||
&& check_exclude(server_exclude_list, fname, is_dir,
|
||||
"server pattern"))
|
||||
if (server_exclude_list.head
|
||||
&& check_exclude(&server_exclude_list, fname, is_dir,
|
||||
"server pattern"))
|
||||
return 1;
|
||||
if (exclude_level != ALL_EXCLUDES)
|
||||
return 0;
|
||||
if (exclude_list && check_exclude(exclude_list, fname, is_dir,
|
||||
"pattern"))
|
||||
if (exclude_list.head
|
||||
&& check_exclude(&exclude_list, fname, is_dir, "pattern"))
|
||||
return 1;
|
||||
if (local_exclude_list
|
||||
&& check_exclude(local_exclude_list, fname, is_dir,
|
||||
"local-cvsignore"))
|
||||
if (local_exclude_list.head
|
||||
&& check_exclude(&local_exclude_list, fname, is_dir,
|
||||
"local-cvsignore"))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -956,10 +956,11 @@ void send_file_name(int f, struct file_list *flist, char *fname,
|
||||
|
||||
if (recursive && S_ISDIR(file->mode)
|
||||
&& !(file->flags & FLAG_MOUNT_POINT)) {
|
||||
struct exclude_struct **last_exclude_list = local_exclude_list;
|
||||
struct exclude_list_struct last_list = local_exclude_list;
|
||||
memset(&local_exclude_list, 0, sizeof local_exclude_list);
|
||||
send_directory(f, flist, f_name_to(file, fbuf));
|
||||
local_exclude_list = last_exclude_list;
|
||||
return;
|
||||
free_exclude_list(&local_exclude_list);
|
||||
local_exclude_list = last_list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -994,8 +995,6 @@ static void send_directory(int f, struct file_list *flist, char *dir)
|
||||
offset++;
|
||||
}
|
||||
|
||||
local_exclude_list = NULL;
|
||||
|
||||
if (cvs_exclude) {
|
||||
if (strlcpy(p, ".cvsignore", MAXPATHLEN - offset)
|
||||
< MAXPATHLEN - offset) {
|
||||
@@ -1029,9 +1028,6 @@ static void send_directory(int f, struct file_list *flist, char *dir)
|
||||
dir, errno, strerror(errno));
|
||||
}
|
||||
|
||||
if (local_exclude_list)
|
||||
free_exclude_list(&local_exclude_list); /* Zeros pointer too */
|
||||
|
||||
closedir(d);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
extern int sanitize_paths;
|
||||
extern char curr_dir[MAXPATHLEN];
|
||||
extern struct exclude_struct **exclude_list;
|
||||
extern struct exclude_list_struct exclude_list;
|
||||
|
||||
int make_backups = 0;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
int modify_window = 0;
|
||||
int module_id = -1;
|
||||
struct exclude_struct **server_exclude_list;
|
||||
struct exclude_list_struct server_exclude_list;
|
||||
|
||||
void rprintf(UNUSED(enum logcode code), const char *format, ...)
|
||||
{
|
||||
@@ -45,7 +45,7 @@ struct exclude_struct **server_exclude_list;
|
||||
exit(code);
|
||||
}
|
||||
|
||||
int check_exclude(UNUSED(struct exclude_struct **list), UNUSED(char *name),
|
||||
int check_exclude(UNUSED(struct exclude_list_struct *listp), UNUSED(char *name),
|
||||
UNUSED(int name_is_dir), UNUSED(const char *type))
|
||||
{
|
||||
/* This function doesn't really get called in this test context, so
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "rsync.h"
|
||||
|
||||
extern int verbose;
|
||||
extern struct exclude_list_struct server_exclude_list;
|
||||
|
||||
int sanitize_paths = 0;
|
||||
|
||||
@@ -471,12 +472,11 @@ int lock_range(int fd, int offset, int len)
|
||||
static int exclude_server_path(char *arg)
|
||||
{
|
||||
char *s;
|
||||
extern struct exclude_struct **server_exclude_list;
|
||||
|
||||
if (server_exclude_list) {
|
||||
if (server_exclude_list.head) {
|
||||
for (s = arg; (s = strchr(s, '/')) != NULL; ) {
|
||||
*s = '\0';
|
||||
if (check_exclude(server_exclude_list, arg, 1,
|
||||
if (check_exclude(&server_exclude_list, arg, 1,
|
||||
"server pattern")) {
|
||||
/* We must leave arg truncated! */
|
||||
return 1;
|
||||
|
||||
Reference in new issue
Block a user