Merge pull request #1 from stellarbear/master

Merged master
This commit is contained in:
Chris Davies
2018-12-11 17:09:03 +00:00
committed by GitHub
2 changed files with 15 additions and 4 deletions
+13 -2
View File
@@ -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);
+2 -2
View File
@@ -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);