diff options
author | auriamg <auria.mg@gmail.com> | 2017-11-01 03:34:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-01 03:34:33 +0300 |
commit | 84440587e1b2e4e9e0727cbba7a455b96820e40a (patch) | |
tree | a81a9a35ec7a38acc61d9cfad1f66892f5aa4ad0 | |
parent | 34dad9cea594d49970078c59470bf4a95a3ba272 (diff) | |
parent | 80cf936c934a9d2c98a30f423f7fdc4bbf117358 (diff) |
Merge pull request #25 from programmingkidx/master
Fix bug with adding symbolic links to the wrong object
-rw-r--r-- | src/Dependency.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Dependency.cpp b/src/Dependency.cpp index ec37863..1b33f3a 100644 --- a/src/Dependency.cpp +++ b/src/Dependency.cpp @@ -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; |