gcc_const static char * FindFile(const char *const*list) { for (const char *const* i = list; *i != nullptr; ++i) { const char *path = *i; if (IsAbsolutePath(path)) { if (File::Exists(path)) return DupString(path); } else { auto *result = FindInSearchPaths(path); if (result != nullptr) return result; } } return nullptr; }
gcc_const static AllocatedPath FindFile(const char *const*list) { for (const char *const* i = list; *i != nullptr; ++i) { const Path path(*i); if (path.IsAbsolute()) { if (File::Exists(path)) return path; } else { auto result = FindInSearchPaths(path); if (result != nullptr) return result; } } return nullptr; }