in tools/runfiles/runfiles_src.cc [170:187]
string Runfiles::Rlocation(const string& path) const {
if (path.empty() || starts_with(path, "../") || contains(path, "/..") ||
starts_with(path, "./") || contains(path, "/./") ||
ends_with(path, "/.") || contains(path, "//")) {
return string();
}
if (IsAbsolute(path)) {
return path;
}
const auto value = runfiles_map_.find(path);
if (value != runfiles_map_.end()) {
return value->second;
}
if (!directory_.empty()) {
return directory_ + "/" + path;
}
return "";
}