Fix outputname bug
This commit is contained in:
+5
-4
@@ -7,12 +7,13 @@
|
|||||||
#define STRINGIFY(x) #x
|
#define STRINGIFY(x) #x
|
||||||
#define STR(x) STRINGIFY(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
|
#define MAKEGEN_VERSION_MAJOR 1
|
||||||
// Release, should be backwards compatible with any minor version
|
// Release, should be backwards compatible
|
||||||
#define MAKEGEN_VERSION_RELEASE 2
|
#define MAKEGEN_VERSION_RELEASE 2
|
||||||
// Minor changes, should be compatible with any other minor version with same major and release.
|
// Minor changes, generally bug fixes
|
||||||
#define MAKEGEN_VERSION_MINOR 0
|
#define MAKEGEN_VERSION_MINOR 1
|
||||||
|
|
||||||
#define MAKEGEN_VERSION ("v" STR(MAKEGEN_VERSION_MAJOR) "." STR(MAKEGEN_VERSION_RELEASE) "." STR(MAKEGEN_VERSION_MINOR))
|
#define MAKEGEN_VERSION ("v" STR(MAKEGEN_VERSION_MAJOR) "." STR(MAKEGEN_VERSION_RELEASE) "." STR(MAKEGEN_VERSION_MINOR))
|
||||||
|
|
||||||
const static unsigned int FLAG_HELP = BIT(0);
|
const static unsigned int FLAG_HELP = BIT(0);
|
||||||
|
|||||||
+5
-4
@@ -27,13 +27,14 @@ ConfigFile::ConfigFile()
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Removes all other characters
|
// Removes all other characters
|
||||||
std::remove_if(
|
auto it = std::remove_if(
|
||||||
outputdir.begin(),
|
outputname.begin(),
|
||||||
outputdir.end(),
|
outputname.end(),
|
||||||
[](unsigned char c)
|
[](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
|
// Add suffix
|
||||||
outputname += ".out";
|
outputname += ".out";
|
||||||
|
|||||||
Reference in New Issue
Block a user