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
Added the relnamecache structure and improved some variable names.
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
1452d6c
..
a51413a
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-1495,8
+1495,9
@@
static void send_implied_dirs(int f, struct file_list *flist, char *fname,
char *start, char *limit, int flags, int is_dot_dir)
{
struct file_struct *file;
char *start, char *limit, int flags, int is_dot_dir)
{
struct file_struct *file;
- item_list *rel_list;
- char **ep, *slash;
+ item_list *relname_list;
+ relnamecache **rnpp;
+ char *slash;
int len, need_new_dir;
flags &= ~FLAG_XFER_DIR;
int len, need_new_dir;
flags &= ~FLAG_XFER_DIR;
@@
-1548,23
+1549,23
@@
static void send_implied_dirs(int f, struct file_list *flist, char *fname,
return; /* dir must have vanished */
len = strlen(limit+1);
return; /* dir must have vanished */
len = strlen(limit+1);
- memcpy(&rel
_list, F_DIR_RELS_P(lastpath_struct), sizeof rel
_list);
- if (!rel_list) {
- if (!(rel_list = new0(item_list)))
+ memcpy(&rel
name_list, F_DIR_RELNAMES_P(lastpath_struct), sizeof relname
_list);
+ if (!rel
name
_list) {
+ if (!(rel
name
_list = new0(item_list)))
out_of_memory("send_implied_dirs");
out_of_memory("send_implied_dirs");
- memcpy(F_DIR_REL
S_P(lastpath_struct), &rel_list, sizeof rel
_list);
+ memcpy(F_DIR_REL
NAMES_P(lastpath_struct), &relname_list, sizeof relname
_list);
}
}
-
ep = EXPAND_ITEM_LIST(rel_list, char
*, 32);
- if (!(*
ep = new_array(char, 1 + len + 1
)))
+
rnpp = EXPAND_ITEM_LIST(relname_list, relnamecache
*, 32);
+ if (!(*
rnpp = (relnamecache*)new_array(char, sizeof (relnamecache) + len
)))
out_of_memory("send_implied_dirs");
out_of_memory("send_implied_dirs");
-
**ep
= is_dot_dir;
- strlcpy(
*ep + 1
, limit+1, len + 1);
+
(*rnpp)->is_dot_dir
= is_dot_dir;
+ strlcpy(
(*rnpp)->fname
, limit+1, len + 1);
}
static void send1extra(int f, struct file_struct *file, struct file_list *flist)
{
char fbuf[MAXPATHLEN];
}
static void send1extra(int f, struct file_struct *file, struct file_list *flist)
{
char fbuf[MAXPATHLEN];
- item_list *rel_list;
+ item_list *rel
name
_list;
int len, dlen, flags = FLAG_DIVERT_DIRS | FLAG_XFER_DIR;
size_t j;
int len, dlen, flags = FLAG_DIVERT_DIRS | FLAG_XFER_DIR;
size_t j;
@@
-1584,17
+1585,18
@@
static void send1extra(int f, struct file_struct *file, struct file_list *flist)
if (!relative_paths)
return;
if (!relative_paths)
return;
- memcpy(&rel
_list, F_DIR_RELS_P(file), sizeof rel
_list);
- if (!rel_list)
+ memcpy(&rel
name_list, F_DIR_RELNAMES_P(file), sizeof relname
_list);
+ if (!rel
name
_list)
return;
return;
- for (j = 0; j < rel_list->count; j++) {
- char *slash, *ep = ((char**)rel_list->items)[j];
- int is_dot_dir = *ep;
+ for (j = 0; j < relname_list->count; j++) {
+ char *slash;
+ relnamecache *rnp = ((relnamecache**)relname_list->items)[j];
+ int is_dot_dir = rnp->is_dot_dir;
fbuf[dlen] = '/';
fbuf[dlen] = '/';
- len = strlcpy(fbuf + dlen + 1,
ep+1
, sizeof fbuf - dlen - 1);
- free(
e
p);
+ len = strlcpy(fbuf + dlen + 1,
rnp->fname
, sizeof fbuf - dlen - 1);
+ free(
rn
p);
if (len >= (int)sizeof fbuf)
continue; /* Impossible... */
if (len >= (int)sizeof fbuf)
continue; /* Impossible... */
@@
-1622,7
+1624,7
@@
static void send1extra(int f, struct file_struct *file, struct file_list *flist)
}
}
}
}
- free(rel_list);
+ free(rel
name
_list);
}
void send_extra_file_list(int f, int at_least)
}
void send_extra_file_list(int f, int at_least)