static string SearchTerminfo (string term)
{
if (term == null || term == String.Empty)
return null;
string path;
string terminfo = Environment.GetEnvironmentVariable ("TERMINFO");
if (terminfo != null && Directory.Exists (terminfo)){
path = TryTermInfoDir (terminfo, term);
if (path != null)
return path;
}
foreach (string dir in locations) {
if (!Directory.Exists (dir))
continue;
path = TryTermInfoDir (dir, term);
if (path != null)
return path;
}
return null;
}