extern int remote_version;
extern int io_error;
-static char **local_exclude_list;
+static struct exclude_struct **local_exclude_list;
int link_stat(const char *Path, STRUCT_STAT *Buffer)
{
*/
static int match_file_name(char *fname,STRUCT_STAT *st)
{
- if (check_exclude(fname,local_exclude_list)) {
+ if (check_exclude(fname,local_exclude_list,st)) {
if (verbose > 2)
rprintf(FINFO,"excluding file %s\n",fname);
return 0;
if (file->gid == last_gid) flags |= SAME_GID;
if (file->modtime == last_time) flags |= SAME_TIME;
- for (l1=0;lastname[l1] && fname[l1] == lastname[l1];l1++) ;
+ for (l1=0;lastname[l1] && (fname[l1] == lastname[l1]) && (l1 < 255);l1++) ;
l2 = strlen(fname) - l1;
if (l1 > 0) flags |= SAME_NAME;
clean_fname(thisname);
+ if (relative_paths && thisname[0] == '/') {
+ /* strip / off absolute paths in destination */
+ memmove(thisname, thisname+1, strlen(thisname));
+ if (!thisname[0]) strcpy(thisname,".");
+ }
+
if ((p = strrchr(thisname,'/'))) {
static char *lastdir;
*p = 0;
file->modtime = st.st_mtime;
file->length = st.st_size;
-#if TRIDGE
- if (st.st_size == 71036)
- file->length += 7000;
-#endif
file->mode = st.st_mode;
file->uid = st.st_uid;
file->gid = st.st_gid;
}
if (S_ISDIR(file->mode) && recursive) {
- char **last_exclude_list = local_exclude_list;
- send_directory(f,flist,f_name(file));
- local_exclude_list = last_exclude_list;
- return;
+ struct exclude_struct **last_exclude_list = local_exclude_list;
+ send_directory(f,flist,f_name(file));
+ local_exclude_list = last_exclude_list;
+ return;
}
}
d = opendir(dir);
if (!d) {
io_error = 1;
- rprintf(FERROR,"%s: %s\n",
+ rprintf(FERROR,"opendir(%s): %s\n",
dir,strerror(errno));
return;
}
if (cvs_exclude) {
if (strlen(fname) + strlen(".cvsignore") <= MAXPATHLEN-1) {
strcpy(p,".cvsignore");
- local_exclude_list = make_exclude_list(fname,NULL,0);
+ local_exclude_list = make_exclude_list(fname,NULL,0,0);
} else {
io_error = 1;
rprintf(FINFO,"cannot cvs-exclude in long-named directory %s\n",fname);
strcmp(dname,"..")==0)
continue;
strlcpy(p,dname,MAXPATHLEN-(l+1));
- send_file_name(f,flist,fname,recurse,FLAG_DELETE);
+ send_file_name(f,flist,fname,recurse,0);
}
closedir(d);
strlcpy(lastpath, fname, sizeof(lastpath)-1);
*p = '/';
for (p=fname+1; (p=strchr(p,'/')); p++) {
+ int copy_links_saved = copy_links;
*p = 0;
+ copy_links = 0;
send_file_name(f, flist, fname, 0, 0);
+ copy_links = copy_links_saved;
*p = '/';
}
} else {
if (f != -1) {
io_end_buffering(f);
- write_flush(f);
}
if (verbose > 2)