Commit ca947dea authored by Wayne Davison's avatar Wayne Davison

Moved the code that adds each file's length to stats.total_size

so that the delete code doesn't change the value.
parent 2aea85ab
......@@ -548,6 +548,9 @@ static void send_file_entry(int f, struct file_struct *file, int ndx)
the_end:
strlcpy(lastname, fname, MAXPATHLEN);
if (S_ISREG(mode) || S_ISLNK(mode))
stats.total_size += F_LENGTH(file);
}
static struct file_struct *recv_file_entry(struct file_list *flist,
......@@ -849,6 +852,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
read_buf(f, bp, checksum_len);
}
if (S_ISREG(mode) || S_ISLNK(mode))
stats.total_size += file_length;
return file;
}
......@@ -1090,9 +1096,6 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
file->mode = save_mode;
}
if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode))
stats.total_size += st.st_size;
if (basename_len == 0+1)
return NULL;
......@@ -1679,9 +1682,6 @@ struct file_list *recv_file_list(int f)
flags |= read_byte(f) << 8;
file = recv_file_entry(flist, flags, f);
if (S_ISREG(file->mode) || S_ISLNK(file->mode))
stats.total_size += F_LENGTH(file);
if (incremental && S_ISDIR(file->mode)) {
flist_expand(dir_flist);
dir_flist->files[dir_flist->count++] = file;
......@@ -2035,7 +2035,7 @@ static void clean_flist(struct file_list *flist, int strip_root, int no_dups)
}
}
}
/* Dump empty all remaining empty dirs. */
/* Dump all remaining empty dirs. */
while (1) {
struct file_struct *fp = flist->files[prev_i];
if (F_DEPTH(fp) >= 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment