Fix outputname bug

This commit is contained in:
Thraix
2019-10-13 20:33:29 +02:00
parent 37d204fa9a
commit 36e4468f5e
2 changed files with 10 additions and 8 deletions
+5 -4
View File
@@ -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);
+5 -4
View File
@@ -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";