From 36e4468f5e4dc7e47e0182683243999a902792bc Mon Sep 17 00:00:00 2001 From: Thraix Date: Sun, 13 Oct 2019 20:33:29 +0200 Subject: [PATCH] Fix outputname bug --- src/Common.h | 9 +++++---- src/ConfigFile.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Common.h b/src/Common.h index 6dea76f..84cf89b 100755 --- a/src/Common.h +++ b/src/Common.h @@ -7,12 +7,13 @@ #define STRINGIFY(x) #x #define STR(x) STRINGIFY(x) -// Major changes, probably not be backwards compatible +// Major changes, might not be backwards compatible #define MAKEGEN_VERSION_MAJOR 1 -// Release, should be backwards compatible with any minor version +// Release, should be backwards compatible #define MAKEGEN_VERSION_RELEASE 2 -// Minor changes, should be compatible with any other minor version with same major and release. -#define MAKEGEN_VERSION_MINOR 0 +// Minor changes, generally bug fixes +#define MAKEGEN_VERSION_MINOR 1 + #define MAKEGEN_VERSION ("v" STR(MAKEGEN_VERSION_MAJOR) "." STR(MAKEGEN_VERSION_RELEASE) "." STR(MAKEGEN_VERSION_MINOR)) const static unsigned int FLAG_HELP = BIT(0); diff --git a/src/ConfigFile.cpp b/src/ConfigFile.cpp index 5347bee..dbdf676 100755 --- a/src/ConfigFile.cpp +++ b/src/ConfigFile.cpp @@ -27,13 +27,14 @@ ConfigFile::ConfigFile() }); // Removes all other characters - std::remove_if( - outputdir.begin(), - outputdir.end(), + auto it = std::remove_if( + outputname.begin(), + outputname.end(), [](unsigned char c) { - return (c < 'a' || c > 'z') && c != '_'; + return (c < '0' || c > '9') && (c < 'a' || c > 'z') && c != '_'; }); + outputname.erase(it, outputname.end()); // Add suffix outputname += ".out";