+ loader_ptr loader;
+ call_registry(ext, loader, lookup);
+ if (loader) prefix = loader->prefix();
+
+ std::vector<std::string>::iterator it;
+ for (it = search_paths_.begin(); it != search_paths_.end(); ++it)
+ {
+ if (!prefix.empty())
+ {
+ // try it with the prefix first
+ path = stlplus::filespec_to_path(*it, prefix);
+ path = stlplus::filespec_to_path(path, name);
+ log_debug("looking for", name, "at", path);
+ if (stlplus::file_exists(path)) return path;
+ }
+
+ path = stlplus::filespec_to_path(*it, name);
+ log_debug("looking for", name, "at", path);
+ if (stlplus::file_exists(path)) return path;
+ }
+
+ log_error("cannot find resource file:", name);
+ return std::string();