private static bool CheckIncludePath(string relativePath, ref string absolutePath)
{
// Note: If the absolutePath exists, it overtakse the include_path search.
if (Path.IsPathRooted(relativePath)) return false;
if (File.Exists(absolutePath)) return false;
string paths = ScriptContext.CurrentContext.Config.FileSystem.IncludePaths;
if (paths == null) return false;
foreach (string s in paths.Split(new char[] { Path.PathSeparator }))
{
if ((s == null) || (s == string.Empty)) continue;
string abs = Path.GetFullPath(Path.Combine(s, relativePath));
if (File.Exists(abs))
{
absolutePath = abs;
return true;
}
}
return false;
}