Merge pull request #25 from programmingkidx/master

Fix bug with adding symbolic links to the wrong object
This commit is contained in:
auriamg 2017-10-31 20:34:33 -04:00 committed by GitHub
commit 84440587e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -193,15 +193,16 @@ std::string Dependency::getInnerPath()
void Dependency::addSymlink(std::string s){ symlinks.push_back(s); }
// comapres the given Dependency with this one. If both refer to the same file,
// Compares the given Dependency with this one. If both refer to the same file,
// it returns true and merges both entries into one.
bool Dependency::mergeIfSameAs(Dependency& dep2)
{
if(dep2.getOriginalFileName().compare(filename) == 0)
{
const int samount = dep2.getSymlinkAmount();
for(int n=0; n<samount; n++)
addSymlink( dep2.getSymlink(n) ); // FIXME - there may be duplicate symlinks
const int samount = getSymlinkAmount();
for(int n=0; n<samount; n++) {
dep2.addSymlink(getSymlink(n)); // FIXME - there may be duplicate symlinks
}
return true;
}
return false;