Skip to content

Commit

Permalink
[XrdCl] Fix regression in recursive copy (introduced in f6723e0).
Browse files Browse the repository at this point in the history
Fixes #1227
  • Loading branch information
simonmichal committed Jun 29, 2020
1 parent c8f3616 commit 76234c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/XrdCl/XrdClCopy.cc
Expand Up @@ -707,7 +707,6 @@ int main( int argc, char **argv )
// If we're doing remote recursive copy, chain all the files (if it's a
// directory)
//----------------------------------------------------------------------------
bool srcIsDir = config.srcFile->Protocol == XrdCpFile::isDir;
if( config.Want( XrdCpConfig::DoRecurse ) &&
config.srcFile->Protocol == XrdCpFile::isXroot )
{
Expand All @@ -718,7 +717,6 @@ int main( int argc, char **argv )
XRootDStatus st = fs->Stat( source.GetPath(), statInfo );
if( st.IsOK() && statInfo->TestFlags( StatInfo::IsDir ) )
{
srcIsDir = true;
//------------------------------------------------------------------------
// Recursively index the remote directory
//------------------------------------------------------------------------
Expand Down Expand Up @@ -779,6 +777,9 @@ int main( int argc, char **argv )
// Set up the job
//--------------------------------------------------------------------------
std::string target = dest;

// if the source was a file Dlen and Doff overlap
bool srcIsDir = std::string( sourceFile->Path ).size() == size_t( sourceFile->Doff + sourceFile->Dlen );
// if this is a recursive copy make sure we preserve the directory structure
if( config.Want( XrdCpConfig::DoRecurse ) && srcIsDir )
{
Expand Down

0 comments on commit 76234c0

Please sign in to comment.