File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,15 @@ about_info keychain_app::version_info::about()
40
40
41
41
std::string keychain_app::version_info::version ()
42
42
{
43
- static const std::regex VERSION_REGEXP (" ^\\ d+\\ .\\ d+\\ -\\ d+ " );
43
+ static const std::regex VERSION_REGEXP (" ^\\ d+\\ .\\ d+( \\ -\\ d)* " );
44
44
std::string description_string ( git_revision_description );
45
45
auto it = std::sregex_iterator (description_string.begin (), description_string.end (), VERSION_REGEXP);
46
46
if (it == std::sregex_iterator ())
47
47
FC_LIGHT_THROW_EXCEPTION (fc_light::internal_error_exception, " Invalid version string has been returned by Git" );
48
48
auto version_string = it->str ();
49
49
auto replace_pos = version_string.find (' -' );
50
- version_string[replace_pos] = ' .' ;
50
+ if (replace_pos != std::string::npos)
51
+ version_string[replace_pos] = ' .' ;
51
52
return version_string;
52
53
}
53
54
You can’t perform that action at this time.
0 commit comments