Skip to content

Commit 392ff58

Browse files
fix runtime version evaluation
1 parent 1d3ba62 commit 392ff58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

keychain_lib/src/version_info.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ about_info keychain_app::version_info::about()
4040

4141
std::string keychain_app::version_info::version()
4242
{
43-
static const std::regex VERSION_REGEXP("^\\d+\\.\\d+\\-\\d+");
43+
static const std::regex VERSION_REGEXP("^\\d+\\.\\d+(\\-\\d)*");
4444
std::string description_string( git_revision_description );
4545
auto it = std::sregex_iterator(description_string.begin(), description_string.end(), VERSION_REGEXP);
4646
if(it == std::sregex_iterator())
4747
FC_LIGHT_THROW_EXCEPTION(fc_light::internal_error_exception, "Invalid version string has been returned by Git");
4848
auto version_string = it->str();
4949
auto replace_pos = version_string.find('-');
50-
version_string[replace_pos] = '.';
50+
if (replace_pos != std::string::npos)
51+
version_string[replace_pos] = '.';
5152
return version_string;
5253
}
5354

0 commit comments

Comments
 (0)