if (sanitize_paths)
sanitize_path(thisname, thisname, "", 0, SP_DEFAULT);
- if (stp && (S_ISDIR(stp->st_mode) || stp->st_mode == 0)) {
+ if (stp && (S_ISDIR(stp->st_mode) || IS_MISSING_FILE(*stp))) {
/* This is needed to handle a "symlink/." with a --relative
* dir, or a request to delete a specific file. */
st = *stp;
full_fname(thisname));
}
return NULL;
- } else if (st.st_mode == 0) {
+ } else if (IS_MISSING_FILE(st)) {
io_error |= IOERR_GENERAL;
rprintf(FINFO, "skipping file with bogus (zero) st_mode: %s\n",
full_fname(thisname));
} else
fn = p;
send_implied_dirs(f, flist, fbuf, fbuf, p, flags,
- st.st_mode == 0 ? MISSING_NAME : name_type);
+ IS_MISSING_FILE(st) ? MISSING_NAME : name_type);
if (fn == p)
continue;
}
#define DIR_FIRST_CHILD(a) (a)[1]
#define DIR_NEXT_SIBLING(a) (a)[2]
+#define IS_MISSING_FILE(statbuf) ((statbuf).st_mode == 0)
+
/*
* Start the flist array at FLIST_START entries and grow it
* by doubling until FLIST_LINEAR then grow by FLIST_LINEAR