From b964901f7d01ad04717535ce3d328200d616be32 Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Fri, 16 Nov 2001 19:19:44 +0000 Subject: [PATCH] Fix to make_file() to exit earlier if a file is excluded, because doing readlink_stat() on an excluded file can be a problem when using the --copy-links option (also known as -L) and the excluded file is a symlink that points nowhere. --- flist.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flist.c b/flist.c index 0cc57f2d..13d50482 100644 --- a/flist.c +++ b/flist.c @@ -490,6 +490,11 @@ struct file_struct *make_file(int f, char *fname, struct string_area **ap, } fname = cleaned_name; + /* f is set to -1 when calculating deletion file list */ + if (((f != -1) || !delete_excluded) && !noexcludes && !match_file_name(fname,&st)) + return NULL; + + memset(sum,0,SUM_LENGTH); if (readlink_stat(fname,&st,linkbuf) != 0) { @@ -512,10 +517,6 @@ struct file_struct *make_file(int f, char *fname, struct string_area **ap, return NULL; } - /* f is set to -1 when calculating deletion file list */ - if (((f != -1) || !delete_excluded) && !match_file_name(fname,&st)) - return NULL; - if (lp_ignore_nonreadable(module_id) && access(fname, R_OK) != 0) return NULL; -- 2.34.1