diff --git a/src/DylibBundler.cpp b/src/DylibBundler.cpp index eb469a1..0792cc1 100644 --- a/src/DylibBundler.cpp +++ b/src/DylibBundler.cpp @@ -246,12 +246,13 @@ void collectSubDependencies() continue; // trim useless info, keep only library name std::string dep_path = lines[n].substr(1, lines[n].rfind(" (") - 1); + std::string full_path = dep_path; if (isRpath(dep_path)) { - dep_path = searchFilenameInRpaths(dep_path); - collectRpathsForFilename(dep_path); + full_path = searchFilenameInRpaths(dep_path); + collectRpathsForFilename(full_path); } - addDependency(dep_path, dep_path); + addDependency(dep_path, full_path); } } // if no more dependencies were added on this iteration, stop searching diff --git a/src/Utils.cpp b/src/Utils.cpp index 338053b..535e81e 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -38,7 +38,7 @@ bool fileExists(std::string filename) } else { std::string delims = " \f\n\r\t\v"; - std::string rtrimmed = filename.substr(0, filename.find_last_not_of(delims) + 1); + std::string rtrimmed = filename.substr(0, filename.find_last_not_of(delims)+1); std::string ftrimmed = rtrimmed.substr(rtrimmed.find_first_not_of(delims)); if (access(ftrimmed.c_str(), F_OK) != -1) return true; @@ -137,13 +137,11 @@ std::string getUserInputDirForFile(const std::string& filename) while (true) { std::cout << "\nPlease specify the directory where this library is located (or enter 'quit' to abort): "; - // fflush(stdout); + fflush(stdout); std::string prefix; std::cin >> prefix; - // std::cout << std::endl; - - // getline(std::cin, prefix); + std::cout << std::endl; if (prefix.compare("quit") == 0) exit(1);