SNMP MIB Compiler: Resolve MIB files in a case-insensitive way

This commit is contained in:
Dirk Ziegelmeier 2016-01-11 20:14:54 +01:00
parent 8c4d1909f4
commit e80e7a10d4

View File

@ -31,12 +31,14 @@ namespace Lextm.SharpSnmpLib.Mib
{
string[] matchedFiles = Directory.GetFiles(
_path,
moduleName + ".*",
"*",
(_recursive) ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
if ((matchedFiles != null) && (matchedFiles.Length >= 1))
{
foreach (string matchedFile in matchedFiles)
{
if (Path.GetFileNameWithoutExtension(matchedFile.ToLowerInvariant()) == moduleName.ToLowerInvariant())
{
try
{
@ -45,13 +47,13 @@ namespace Lextm.SharpSnmpLib.Mib
{
return md.Modules [0];
}
}
catch
} catch
{
}
}
}
}
}
return null;
}