From 47fbc5e1067e71190ce5d39303287e634e8c8fc1 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Mon, 8 Feb 2021 02:51:44 +0000 Subject: [PATCH] update decomp.bat in accordance to project directory changes + bugfix (#243) * ObjectFileDB: Fix crash if obj list text has no objects * rename "decomp.bat" to "decomp-jak1.bat" --- decomp.bat => decomp-jak1.bat | 4 ++-- decompiler/ObjectFile/ObjectFileDB.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) rename decomp.bat => decomp-jak1.bat (88%) diff --git a/decomp.bat b/decomp-jak1.bat similarity index 88% rename from decomp.bat rename to decomp-jak1.bat index e28ad3dbbe..cdce6ab532 100644 --- a/decomp.bat +++ b/decomp-jak1.bat @@ -1,7 +1,7 @@ @echo off :: The caret ^ acts as a line break but does not make the next line a different command. -out\build\Release\bin\decompiler decompiler\config\jak1_ntsc_black_label.jsonc iso_data ^ -decompiler_out +out\build\Release\bin\decompiler decompiler\config\jak1_ntsc_black_label.jsonc iso_data\jak1 ^ +decompiler_out\jak1 :: The pause command makes the batch operation halt with a "Press any key to continue..." message. :: Useful for example if the decompiler failed and exited for whatever reason, or for verifying its :: success. diff --git a/decompiler/ObjectFile/ObjectFileDB.cpp b/decompiler/ObjectFile/ObjectFileDB.cpp index 60cb346f52..3c20da85f3 100644 --- a/decompiler/ObjectFile/ObjectFileDB.cpp +++ b/decompiler/ObjectFile/ObjectFileDB.cpp @@ -417,8 +417,10 @@ std::string ObjectFileDB::generate_obj_listing() { assert(int(all_unique_names.size()) == unique_count); } - result.pop_back(); // kill last new line - result.pop_back(); // kill last comma + if (result.length() >= 2) { + result.pop_back(); // kill last new line + result.pop_back(); // kill last comma + } return result + "]"; }