diff options
author | Diegoisawesome <diego@domoreaweso.me> | 2018-09-14 22:35:04 -0500 |
---|---|---|
committer | Diegoisawesome <diego@domoreaweso.me> | 2018-09-14 22:35:04 -0500 |
commit | e8be47abb880a06090f36a7305ab0e4f59f0a701 (patch) | |
tree | b147f92fe4a5ef7c293726a66e26a20d62429fda /tools/mid2agb/main.cpp | |
parent | b860d583e4a5b6fd39e725df998ee9837f7f3029 (diff) |
Add running status to mid2agb
Diffstat (limited to 'tools/mid2agb/main.cpp')
-rw-r--r-- | tools/mid2agb/main.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/mid2agb/main.cpp b/tools/mid2agb/main.cpp index 9b883fba5..5659e49b1 100644 --- a/tools/mid2agb/main.cpp +++ b/tools/mid2agb/main.cpp @@ -73,6 +73,18 @@ static std::string StripExtension(std::string s) return s; } +static std::string StripPathAndExtension(std::string s) +{ + std::size_t pos = s.find_last_of("/\\"); + + if (pos > 0 && pos != std::string::npos) + { + s = s.substr(pos + 1, pos); + } + + return StripExtension(s); +} + static std::string GetExtension(std::string s) { std::size_t pos = s.find_last_of('.'); @@ -206,7 +218,7 @@ int main(int argc, char** argv) RaiseError("output filename extension is not \"s\""); if (g_asmLabel.empty()) - g_asmLabel = StripExtension(outputFilename); + g_asmLabel = StripPathAndExtension(outputFilename); g_inputFile = std::fopen(inputFilename.c_str(), "rb"); |