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
Changed the non-globbing version of glob_expand_one() so that it
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
5735536
..
35bbed1
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-211,6
+211,8
@@
int link_stat(const char *path, STRUCT_STAT * buffer)
*/
static int check_exclude_file(char *fname, int is_dir, int exclude_level)
{
*/
static int check_exclude_file(char *fname, int is_dir, int exclude_level)
{
+ int rc;
+
#if 0 /* This currently never happens, so avoid a useless compare. */
if (exclude_level == NO_EXCLUDES)
return 0;
#if 0 /* This currently never happens, so avoid a useless compare. */
if (exclude_level == NO_EXCLUDES)
return 0;
@@
-227,17
+229,15
@@
static int check_exclude_file(char *fname, int is_dir, int exclude_level)
}
}
if (server_exclude_list.head
}
}
if (server_exclude_list.head
- && check_exclude(&server_exclude_list, fname, is_dir,
- "server pattern"))
+ && check_exclude(&server_exclude_list, fname, is_dir) < 0)
return 1;
if (exclude_level != ALL_EXCLUDES)
return 0;
if (exclude_list.head
return 1;
if (exclude_level != ALL_EXCLUDES)
return 0;
if (exclude_list.head
- &&
check_exclude(&exclude_list, fname, is_dir, "pattern")
)
- return
1
;
+ &&
(rc = check_exclude(&exclude_list, fname, is_dir)) != 0
)
+ return
rc < 0
;
if (local_exclude_list.head
if (local_exclude_list.head
- && check_exclude(&local_exclude_list, fname, is_dir,
- "local-cvsignore"))
+ && check_exclude(&local_exclude_list, fname, is_dir) < 0)
return 1;
return 0;
}
return 1;
return 0;
}
@@
-539,6
+539,7
@@
void receive_file_entry(struct file_struct **fptr, unsigned short flags,
rdev_major = 0;
uid = 0, gid = 0;
*lastname = '\0';
rdev_major = 0;
uid = 0, gid = 0;
*lastname = '\0';
+ lastdir_len = -1;
return;
}
return;
}
@@
-745,7
+746,7
@@
struct file_struct *make_file(char *fname,
char *basename, *dirname, *bp;
unsigned short flags = 0;
char *basename, *dirname, *bp;
unsigned short flags = 0;
- if (!flist
) /* lastdir isn't valid if flist is NULL
*/
+ if (!flist
|| !flist->count) /* Ignore lastdir when invalid.
*/
lastdir_len = -1;
if (strlcpy(thisname, fname, sizeof thisname)
lastdir_len = -1;
if (strlcpy(thisname, fname, sizeof thisname)
@@
-947,7
+948,7
@@
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_list_struct last_list = local_exclude_list;
if (recursive && S_ISDIR(file->mode)
&& !(file->flags & FLAG_MOUNT_POINT)) {
struct exclude_list_struct last_list = local_exclude_list;
-
memset(&local_exclude_list, 0, sizeof local_exclude_list)
;
+
local_exclude_list.head = local_exclude_list.tail = NULL
;
send_directory(f, flist, f_name_to(file, fbuf));
free_exclude_list(&local_exclude_list);
local_exclude_list = last_list;
send_directory(f, flist, f_name_to(file, fbuf));
free_exclude_list(&local_exclude_list);
local_exclude_list = last_list;
@@
-989,7
+990,7
@@
static void send_directory(int f, struct file_list *flist, char *dir)
if (strlcpy(p, ".cvsignore", MAXPATHLEN - offset)
< MAXPATHLEN - offset) {
add_exclude_file(&local_exclude_list, fname,
if (strlcpy(p, ".cvsignore", MAXPATHLEN - offset)
< MAXPATHLEN - offset) {
add_exclude_file(&local_exclude_list, fname,
- XFLG_WORD_SPLIT | XFLG_
NO_PREFIXES
);
+ XFLG_WORD_SPLIT | XFLG_
WORDS_ONLY
);
} else {
io_error |= IOERR_GENERAL;
rprintf(FINFO,
} else {
io_error |= IOERR_GENERAL;
rprintf(FINFO,
@@
-1517,11
+1518,17
@@
int f_name_cmp(struct file_struct *f1, struct file_struct *f2)
if (!(c1 = (uchar*)f1->dirname)) {
state1 = fnc_BASE;
c1 = (uchar*)f1->basename;
if (!(c1 = (uchar*)f1->dirname)) {
state1 = fnc_BASE;
c1 = (uchar*)f1->basename;
+ } else if (!*c1) {
+ state1 = fnc_SLASH;
+ c1 = (uchar*)"/";
} else
state1 = fnc_DIR;
if (!(c2 = (uchar*)f2->dirname)) {
state2 = fnc_BASE;
c2 = (uchar*)f2->basename;
} else
state1 = fnc_DIR;
if (!(c2 = (uchar*)f2->dirname)) {
state2 = fnc_BASE;
c2 = (uchar*)f2->basename;
+ } else if (!*c2) {
+ state2 = fnc_SLASH;
+ c2 = (uchar*)"/";
} else
state2 = fnc_DIR;
} else
state2 = fnc_DIR;