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
Improved the call to f_name_cmp().
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
c60bd2b
..
252b91a
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-64,7
+64,6
@@
extern int copy_links;
extern int copy_unsafe_links;
extern int protocol_version;
extern int sanitize_paths;
extern int copy_unsafe_links;
extern int protocol_version;
extern int sanitize_paths;
-extern int delete_excluded;
extern int max_delete;
extern int orig_umask;
extern int list_only;
extern int max_delete;
extern int orig_umask;
extern int list_only;
@@
-976,11
+975,7
@@
void send_file_name(int f, struct file_list *flist, char *fname,
struct file_struct *file;
char fbuf[MAXPATHLEN];
struct file_struct *file;
char fbuf[MAXPATHLEN];
- /* f is set to -1 when calculating deletion file list */
- file = make_file(fname, flist,
- f == -1 && delete_excluded? SERVER_FILTERS : ALL_FILTERS);
-
- if (!file)
+ if (!(file = make_file(fname, flist, ALL_FILTERS)))
return;
maybe_emit_filelist_progress(flist);
return;
maybe_emit_filelist_progress(flist);
@@
-1520,7
+1515,7
@@
static void output_flist(struct file_list *flist, const char *whose_list)
}
}
-enum fnc_state {
fnc_DIR, fnc_SLASH, fnc_BASE, fnc
_TRAILING };
+enum fnc_state {
s_DIR, s_SLASH, s_BASE, s
_TRAILING };
/* Compare the names of two file_struct entities, similar to how strcmp()
* would do if it were operating on the joined strings. The only difference
/* Compare the names of two file_struct entities, similar to how strcmp()
* would do if it were operating on the joined strings. The only difference
@@
-1552,62
+1547,62
@@
int f_name_cmp(struct file_struct *f1, struct file_struct *f2)
if (c1 == c2)
c1 = c2 = NULL;
if (!c1) {
if (c1 == c2)
c1 = c2 = NULL;
if (!c1) {
- state1 =
fnc
_BASE;
+ state1 =
s
_BASE;
c1 = (uchar*)f1->basename;
} else if (!*c1) {
c1 = (uchar*)f1->basename;
} else if (!*c1) {
- state1 =
fnc
_SLASH;
+ state1 =
s
_SLASH;
c1 = (uchar*)"/";
} else
c1 = (uchar*)"/";
} else
- state1 =
fnc
_DIR;
+ state1 =
s
_DIR;
if (!c2) {
if (!c2) {
- state2 =
fnc
_BASE;
+ state2 =
s
_BASE;
c2 = (uchar*)f2->basename;
} else if (!*c2) {
c2 = (uchar*)f2->basename;
} else if (!*c2) {
- state2 =
fnc
_SLASH;
+ state2 =
s
_SLASH;
c2 = (uchar*)"/";
} else
c2 = (uchar*)"/";
} else
- state2 =
fnc
_DIR;
+ state2 =
s
_DIR;
while (1) {
if ((dif = (int)*c1 - (int)*c2) != 0)
break;
if (!*++c1) {
switch (state1) {
while (1) {
if ((dif = (int)*c1 - (int)*c2) != 0)
break;
if (!*++c1) {
switch (state1) {
- case
fnc
_DIR:
- state1 =
fnc
_SLASH;
+ case
s
_DIR:
+ state1 =
s
_SLASH;
c1 = (uchar*)"/";
break;
c1 = (uchar*)"/";
break;
- case
fnc
_SLASH:
- state1 =
fnc
_BASE;
+ case
s
_SLASH:
+ state1 =
s
_BASE;
c1 = (uchar*)f1->basename;
break;
c1 = (uchar*)f1->basename;
break;
- case
fnc
_BASE:
- state1 =
fnc
_TRAILING;
+ case
s
_BASE:
+ state1 =
s
_TRAILING;
if (protocol_version >= 29 && S_ISDIR(f1->mode))
c1 = (uchar*)"/";
break;
if (protocol_version >= 29 && S_ISDIR(f1->mode))
c1 = (uchar*)"/";
break;
- case
fnc
_TRAILING:
+ case
s
_TRAILING:
break;
}
}
if (!*++c2) {
switch (state2) {
break;
}
}
if (!*++c2) {
switch (state2) {
- case
fnc
_DIR:
- state2 =
fnc
_SLASH;
+ case
s
_DIR:
+ state2 =
s
_SLASH;
c2 = (uchar*)"/";
break;
c2 = (uchar*)"/";
break;
- case
fnc
_SLASH:
- state2 =
fnc
_BASE;
+ case
s
_SLASH:
+ state2 =
s
_BASE;
c2 = (uchar*)f2->basename;
break;
c2 = (uchar*)f2->basename;
break;
- case
fnc
_BASE:
- if (state1 ==
fnc
_TRAILING)
+ case
s
_BASE:
+ if (state1 ==
s
_TRAILING)
return 0;
return 0;
- state2 =
fnc
_TRAILING;
+ state2 =
s
_TRAILING;
if (protocol_version >= 29 && S_ISDIR(f2->mode))
c2 = (uchar*)"/";
break;
if (protocol_version >= 29 && S_ISDIR(f2->mode))
c2 = (uchar*)"/";
break;
- case
fnc
_TRAILING:
+ case
s
_TRAILING:
break;
}
}
break;
}
}