Skip to content

Commit

Permalink
BE_AEGv1.0.3 (Fixes, clarifications)
Browse files Browse the repository at this point in the history
A newline is also added before script logs are appended to
"BE_AEG_scripts.log" (if you choose to back them up).

The double quotes that wrapped exceptions should no longer be escaped.
(oops)

Newlines inside exceptions should no longer be escaped. (oops)

Duplicate exceptions (code) are made a bit more obvious in the debug
file.
  • Loading branch information
eraser1 committed Aug 5, 2016
1 parent 9cdd691 commit 14a6060
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Binary file modified BE_AEG.exe
Binary file not shown.
16 changes: 9 additions & 7 deletions be_aeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ int main(int argc, char* argv[])
{
debug_file.open("BE_AutoExceptionGenerator.log", ios::app);

debug_file << "\n\nLAUNCH BE_AEG v1.0.2 (" << get_TimeDate() << ") launch params: " << launch_params << endl;
debug_file << "\n\nLAUNCH BE_AEG v1.0.3 (" << get_TimeDate() << ") launch params: " << launch_params << endl;
}


Expand All @@ -287,10 +287,11 @@ int main(int argc, char* argv[])
}
}


if (backup_script_logs)
{
ofstream scripts_log_backup("BE_AEG_scripts.log", ios::app);
scripts_log_backup << fileStr;
scripts_log_backup << "\n" << fileStr; // Add an extra newline before appending the new script logs just in case.
}


Expand All @@ -316,11 +317,11 @@ int main(int argc, char* argv[])

if (!in_vector(prev_exceptions_restriction_num, code))
{
// Replace newlines
string exception = " !=\"" + regex_replace(code,rgx_match_newlines, "\\n") + "\"";

// Escape double quotes and backslashes
exception = regex_replace(exception,rgx_match_rgx_chars, "\\$&");
string exception = regex_replace(code,rgx_match_rgx_chars, "\\$&");

// Replace newlines, add a "!=" to the beginning, as well as wrap the exception in quotes
exception = " !=\"" + regex_replace(exception,rgx_match_newlines, "\\n") + "\"";

string new_exceptions_line = vector_get(new_exceptions ,restriction_num) + exception;

Expand All @@ -338,7 +339,7 @@ int main(int argc, char* argv[])
}
else if (debug_file.is_open())
{
debug_file << "(" << get_TimeDate() << ") Script Restriction #" << restriction << " produced DUPLICATED exception, code: " << code << endl;
debug_file << "(" << get_TimeDate() << ") DUPLICATE Script Restriction #" << restriction << " produced DUPLICATED exception, code: " << code << endl;
}


Expand Down Expand Up @@ -396,6 +397,7 @@ int main(int argc, char* argv[])
ofile << scripts_fileStr;
ofile.close();


// Empty the scripts log since we've now generated the exceptions
ofstream scripts_log("scripts.log", ios::trunc);
scripts_log.close();
Expand Down
2 changes: 1 addition & 1 deletion with ALL the launch params.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BE_AEG_v100.exe noScriptLogBackup noLogs enableDebugConsole runOnce
BE_AEG.exe noScriptLogBackup noLogs enableDebugConsole runOnce
2 changes: 1 addition & 1 deletion with console debug.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BE_AEG_v100.exe enableDebugConsole
BE_AEG.exe enableDebugConsole

0 comments on commit 14a6060

Please sign in to comment.