fix error in addDependency for sub dependencies

This commit is contained in:
SCG82 2019-12-15 17:43:42 -08:00
parent 1ba60166f1
commit 6f5cba0021
2 changed files with 7 additions and 8 deletions

View File

@ -246,12 +246,13 @@ void collectSubDependencies()
continue; continue;
// trim useless info, keep only library name // trim useless info, keep only library name
std::string dep_path = lines[n].substr(1, lines[n].rfind(" (") - 1); std::string dep_path = lines[n].substr(1, lines[n].rfind(" (") - 1);
std::string full_path = dep_path;
if (isRpath(dep_path)) { if (isRpath(dep_path)) {
dep_path = searchFilenameInRpaths(dep_path); full_path = searchFilenameInRpaths(dep_path);
collectRpathsForFilename(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 // if no more dependencies were added on this iteration, stop searching

View File

@ -38,7 +38,7 @@ bool fileExists(std::string filename)
} }
else { else {
std::string delims = " \f\n\r\t\v"; 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)); std::string ftrimmed = rtrimmed.substr(rtrimmed.find_first_not_of(delims));
if (access(ftrimmed.c_str(), F_OK) != -1) if (access(ftrimmed.c_str(), F_OK) != -1)
return true; return true;
@ -137,13 +137,11 @@ std::string getUserInputDirForFile(const std::string& filename)
while (true) { while (true) {
std::cout << "\nPlease specify the directory where this library is located (or enter 'quit' to abort): "; std::cout << "\nPlease specify the directory where this library is located (or enter 'quit' to abort): ";
// fflush(stdout); fflush(stdout);
std::string prefix; std::string prefix;
std::cin >> prefix; std::cin >> prefix;
// std::cout << std::endl; std::cout << std::endl;
// getline(std::cin, prefix);
if (prefix.compare("quit") == 0) if (prefix.compare("quit") == 0)
exit(1); exit(1);