aboutsummaryrefslogtreecommitdiffstats
path: root/flist.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-12-16 07:18:41 +0000
committerWayne Davison <wayned@samba.org>2006-12-16 07:18:41 +0000
commitc58c1dc44601db434a9fdfa923d1b123dc9a0f25 (patch)
treeeedf583665f80c22eb12b48e0301fd511c4d04ad /flist.c
parenteefe189e1d8a7919d3b69a8db6dede3cf7f8c250 (diff)
downloadandroid_external_rsync-c58c1dc44601db434a9fdfa923d1b123dc9a0f25.tar.gz
android_external_rsync-c58c1dc44601db434a9fdfa923d1b123dc9a0f25.tar.bz2
android_external_rsync-c58c1dc44601db434a9fdfa923d1b123dc9a0f25.zip
Added a basename var to file_struct at the end, making it clearer
where the basename exists without actually changing how the data is organized.
Diffstat (limited to 'flist.c')
-rw-r--r--flist.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/flist.c b/flist.c
index 3dadeab4..11bd2598 100644
--- a/flist.c
+++ b/flist.c
@@ -740,7 +740,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
#ifdef SUPPORT_LINKS
if (linkname_len) {
- bp = (char*)F_BASENAME(file) + basename_len;
+ bp = (char*)file->basename + basename_len;
if (first_hlink_ndx >= 0) {
struct file_struct *first = flist->files[first_hlink_ndx];
memcpy(bp, F_SYMLINK(first), linkname_len);
@@ -997,7 +997,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
#ifdef SUPPORT_LINKS
if (linkname_len) {
- bp = (char*)F_BASENAME(file) + basename_len;
+ bp = (char*)file->basename + basename_len;
memcpy(bp, linkname, linkname_len);
}
#endif
@@ -1795,7 +1795,7 @@ static void output_flist(struct file_list *flist)
dir = slash = "";
else
slash = "/";
- name = F_BASENAME(file);
+ name = file->basename;
trail = S_ISDIR(file->mode) ? "/" : "";
} else
dir = slash = name = trail = "";
@@ -1846,7 +1846,7 @@ int f_name_cmp(struct file_struct *f1, struct file_struct *f2)
c1 = c2 = NULL;
if (!c1) {
type1 = S_ISDIR(f1->mode) ? t_path : t_ITEM;
- c1 = (uchar*)F_BASENAME(f1);
+ c1 = (const uchar*)f1->basename;
if (type1 == t_PATH && *c1 == '.' && !c1[1]) {
type1 = t_ITEM;
state1 = s_TRAILING;
@@ -1859,7 +1859,7 @@ int f_name_cmp(struct file_struct *f1, struct file_struct *f2)
}
if (!c2) {
type2 = S_ISDIR(f2->mode) ? t_path : t_ITEM;
- c2 = (uchar*)F_BASENAME(f2);
+ c2 = (const uchar*)f2->basename;
if (type2 == t_PATH && *c2 == '.' && !c2[1]) {
type2 = t_ITEM;
state2 = s_TRAILING;
@@ -1883,7 +1883,7 @@ int f_name_cmp(struct file_struct *f1, struct file_struct *f2)
break;
case s_SLASH:
type1 = S_ISDIR(f1->mode) ? t_path : t_ITEM;
- c1 = (uchar*)F_BASENAME(f1);
+ c1 = (const uchar*)f1->basename;
if (type1 == t_PATH && *c1 == '.' && !c1[1]) {
type1 = t_ITEM;
state1 = s_TRAILING;
@@ -1913,7 +1913,7 @@ int f_name_cmp(struct file_struct *f1, struct file_struct *f2)
break;
case s_SLASH:
type2 = S_ISDIR(f2->mode) ? t_path : t_ITEM;
- c2 = (uchar*)F_BASENAME(f2);
+ c2 = (const uchar*)f2->basename;
if (type2 == t_PATH && *c2 == '.' && !c2[1]) {
type2 = t_ITEM;
state2 = s_TRAILING;
@@ -1968,9 +1968,9 @@ char *f_name(struct file_struct *f, char *fbuf)
int len = strlen(f->dirname);
memcpy(fbuf, f->dirname, len);
fbuf[len] = '/';
- strlcpy(fbuf + len + 1, F_BASENAME(f), MAXPATHLEN - (len + 1));
+ strlcpy(fbuf + len + 1, f->basename, MAXPATHLEN - (len + 1));
} else
- strlcpy(fbuf, F_BASENAME(f), MAXPATHLEN);
+ strlcpy(fbuf, f->basename, MAXPATHLEN);
return fbuf;
}