From 60c8d7bc7f693e568e6a60a82a433f8534b1e26e Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Fri, 4 Aug 2000 21:11:46 +0000 Subject: [PATCH] Enable --compare-dest to work in combination with --always-checksum. Problem and suggested patch from Dean Scothern dino@cricinfo.com (although I re-wrote the patch). --- generator.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/generator.c b/generator.c index a6a9a5a9..8aa9c06f 100644 --- a/generator.c +++ b/generator.c @@ -35,6 +35,7 @@ extern int size_only; extern int io_timeout; extern int remote_version; extern int always_checksum; +extern char *compare_dest; /* choose whether to skip a particular file */ @@ -49,6 +50,15 @@ static int skip_file(char *fname, of the file time to determine whether to sync */ if (always_checksum && S_ISREG(st->st_mode)) { char sum[MD4_SUM_LENGTH]; + char fnamecmpdest[MAXPATHLEN]; + + if (compare_dest != NULL) { + if (access(fname, 0) != 0) { + slprintf(fnamecmpdest,MAXPATHLEN,"%s/%s", + compare_dest,fname); + fname = fnamecmpdest; + } + } file_checksum(fname,sum,st->st_size); if (remote_version < 21) { return (memcmp(sum,file->sum,2) == 0); -- 2.34.1