+
+ vector<string> real_search_dirs;
+ if (!filename.empty() && filename[0] == '/') {
+ real_search_dirs.push_back("");
+ } else {
+ real_search_dirs = search_dirs;
+ }
+
+ for (const string &dir : real_search_dirs) {
+ string path;
+ if (dir.empty()) {
+ path = filename;
+ } else {
+ path = dir + "/" + filename;
+ }