private static bool CheckIncludePath(Context ctx, 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;
var paths = ctx.IncludePaths;
if (paths == null || paths.Length == 0) return false;
foreach (string s in paths)
{
if (string.IsNullOrEmpty(s)) continue;
string abs = Path.GetFullPath(Path.Combine(s, relativePath));
if (File.Exists(abs))
{
absolutePath = abs;
return true;
}
}
return false;
}