mirror of
https://github.com/stellarbear/YaraSharp
synced 2026-06-08 17:36:09 +00:00
Merge pull request #3 from ChrisDavies-MSFT/WarningBug
Yara warnings were threated as errors
This commit is contained in:
+13
-2
@@ -98,8 +98,19 @@ namespace YaraSharp
|
||||
UNREFERENCED_PARAMETER(ErrorLevel);
|
||||
UNREFERENCED_PARAMETER(UserData);
|
||||
|
||||
auto msg = String::Format("{0} in line {1} in file: {2}",
|
||||
marshal_as<String^>(Message), LineNumber,
|
||||
String^ errorLevel;
|
||||
|
||||
if (ErrorLevel == YARA_ERROR_LEVEL_ERROR)
|
||||
{
|
||||
errorLevel = "ERROR";
|
||||
}
|
||||
else if (ErrorLevel == YARA_ERROR_LEVEL_WARNING)
|
||||
{
|
||||
errorLevel = "WARNING";
|
||||
}
|
||||
|
||||
auto msg = String::Format("{0}: {1} on line {2} in file: {3}",
|
||||
errorLevel, marshal_as<String^>(Message), LineNumber,
|
||||
Filename ? marshal_as<String^>(Filename) : "[none]");
|
||||
|
||||
Errors->Add(msg);
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace YaraSharp
|
||||
{
|
||||
CCompiler^ TestCompiler = gcnew CCompiler(ExternalVariables);
|
||||
|
||||
if (TestCompiler->AddFile(FilePathList[i]))
|
||||
if (TestCompiler->AddFile(FilePathList[i]) || TestCompiler->GetErrors()->Count > 0)
|
||||
{
|
||||
CompilationErrors->Add(FilePathList[i], TestCompiler->GetErrors());
|
||||
FilePathList->Remove(FilePathList[i--]);
|
||||
@@ -31,7 +31,7 @@ namespace YaraSharp
|
||||
CCompiler^ TestCompiler = gcnew CCompiler(ExternalVariables);
|
||||
for each (auto FilePath in FilePathList)
|
||||
{
|
||||
if (TestCompiler->AddFile(FilePath))
|
||||
if (TestCompiler->AddFile(FilePath) || TestCompiler->GetErrors()->Count > 0)
|
||||
{
|
||||
CompilationErrors->Add(FilePath, TestCompiler->GetErrors());
|
||||
FilePathList->Remove(FilePath);
|
||||
|
||||
Reference in New Issue
Block a user