static int deletion_count = 0; /* used to implement --max-delete */
-/* For calling delete_item() */
+/* For calling delete_item() and delete_dir_contents(). */
#define DEL_RECURSE (1<<1) /* recurse */
-#define DEL_DIR_IS_EMPTY (1<<2) /* used by delete_dir_contents() */
+#define DEL_DIR_IS_EMPTY (1<<2) /* internal delete_FUNCTIONS use only */
enum nonregtype {
TYPE_DIR, TYPE_SPECIAL, TYPE_DEVICE, TYPE_SYMLINK
}
void itemize(struct file_struct *file, int ndx, int statret, STRUCT_STAT *st,
- int32 iflags, uchar fnamecmp_type, char *xname)
+ int32 iflags, uchar fnamecmp_type, const char *xname)
{
if (statret >= 0) { /* A from-dest-dir statret can == 1! */
int keep_time = !preserve_times ? 0
sum->flength = len;
sum->blength = blength;
sum->s2length = s2length;
- sum->remainder = len % blength;
- sum->count = len / blength + (sum->remainder != 0);
+ sum->remainder = (int32)(len % blength);
+ sum->count = (int32)(len / blength) + (sum->remainder != 0);
if (sum->count && verbose > 2) {
rprintf(FINFO,
enum logcode code, int f_out)
{
static int missing_below = -1, excluded_below = -1;
- static char *parent_dirname = "";
+ static const char *parent_dirname = "";
static struct file_list *fuzzy_dirlist = NULL;
static int need_fuzzy_dirlist = 0;
struct file_struct *fuzzy_file = NULL;
statret = -1;
stat_errno = ENOENT;
} else {
- char *dn = file->dirname ? file->dirname : ".";
+ const char *dn = file->dirname ? file->dirname : ".";
if (parent_dirname != dn && strcmp(parent_dirname, dn) != 0) {
if (relative_paths && !implied_dirs
&& do_stat(dn, &st) < 0
parent_dirname = dn;
if (need_fuzzy_dirlist && S_ISREG(file->mode)) {
- fuzzy_dirlist = get_dirlist(dn, -1, 1);
+ strlcpy(fnamecmpbuf, dn, sizeof fnamecmpbuf);
+ fuzzy_dirlist = get_dirlist(fnamecmpbuf, -1, 1);
need_fuzzy_dirlist = 0;
}