Skip to content

Commit

Permalink
Use console output instead of acs.err if the file does not exist afte…
Browse files Browse the repository at this point in the history
…r compiling acs with errors
  • Loading branch information
sirjuddington committed Jun 20, 2014
1 parent c815025 commit 7708c6c
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/EntryOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1205,8 +1205,12 @@ bool EntryOperations::compileACS(ArchiveEntry* entry, bool hexen, ArchiveEntry*

// Log output
theConsole->logMessage("ACC.exe Output:");
string output_log;
for (unsigned a = 0; a < output.size(); a++)
{
theConsole->logMessage(output[a]);
output_log += output[a];
}

// Deal with focus-stealing apps
if (parent)
Expand Down Expand Up @@ -1264,12 +1268,18 @@ bool EntryOperations::compileACS(ArchiveEntry* entry, bool hexen, ArchiveEntry*
}
else
{
// Read acs.err to string
wxFile file(appPath("acs.err", DIR_TEMP));
char* buf = new char[file.Length()];
file.Read(buf, file.Length());
string errors = wxString::From8BitData(buf, file.Length());
delete[] buf;
string errors;
if (wxFileExists(appPath("acs.err", DIR_TEMP)))
{
// Read acs.err to string
wxFile file(appPath("acs.err", DIR_TEMP));
char* buf = new char[file.Length()];
file.Read(buf, file.Length());
string errors = wxString::From8BitData(buf, file.Length());
delete[] buf;
}
else
errors = output_log;

ExtMessageDialog dlg(NULL, "Error Compiling");
dlg.setMessage("The following errors were encountered while compiling, please fix them and recompile:");
Expand Down

0 comments on commit 7708c6c

Please sign in to comment.