Skip to content

Commit

Permalink
Merge pull request #19157 from asselitx/renameBadPath-HPCC-32639
Browse files Browse the repository at this point in the history
HPCC-32639 Correct ECLWatch rename file path

Reviewed-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Merged-by: Gavin Halliday <ghalliday@hpccsystems.com>
  • Loading branch information
ghalliday authored Oct 16, 2024
2 parents f138e12 + 9293ae5 commit 98cf1b2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions dali/base/dadfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,19 @@ inline unsigned groupDistance(IGroup *grp1,IGroup *grp2)
return grp1->distance(grp2);
}

inline StringBuffer &appendEnsurePathSepChar(StringBuffer &dest, StringBuffer &newPart, char psc)
{
addPathSepChar(dest, psc);
if (newPart.length() > 0)
{
if (isPathSepChar(newPart.charAt(0)))
dest.append(newPart.str()+1);
else
dest.append(newPart);
}
return dest;
}


static StringBuffer &normalizeFormat(StringBuffer &in)
{
Expand Down Expand Up @@ -4474,7 +4487,8 @@ protected: friend class CDistributedFilePart;
if (isPathSepChar(newPath.charAt(newPath.length()-1)))
newPath.setLength(newPath.length()-1);
newPath.remove(0, myBase.length());
newdir.append(baseDir).append(newPath);
newdir.append(baseDir);
appendEnsurePathSepChar(newdir, newPath, psc);
StringBuffer fullname;
CIArrayOf<CIStringArray> newNames;
unsigned i;
Expand All @@ -4493,7 +4507,8 @@ protected: friend class CDistributedFilePart;

StringBuffer copyDir(baseDir);
adjustClusterDir(i, copy, copyDir);
fullname.clear().append(copyDir).append(newPath);
fullname.clear().append(copyDir);
appendEnsurePathSepChar(fullname, newPath, psc);
newNames.item(i).append(fullname);
}
}
Expand Down

0 comments on commit 98cf1b2

Please sign in to comment.