Skip to content

Commit

Permalink
Merge pull request #106 from CyberShadow/pull-20230821-073531
Browse files Browse the repository at this point in the history
deimos.openssl.opensslv: Fix parsing versions with suffixes
  • Loading branch information
CyberShadow authored Aug 21, 2023
2 parents 1f88418 + 789a3f0 commit da92bb3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/deimos/openssl/opensslv.di
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ private OpenSSLVersionStruct parseOpenSSLVersion()(string textVersion)

v.text = textVersion;

textVersion = textVersion.splitter('-').front;

v.major = textVersion.splitter('.')
.front.to!uint;
assert (v.major >= 0);
Expand Down Expand Up @@ -115,6 +117,14 @@ private OpenSSLVersionStruct parseOpenSSLVersion()(string textVersion)
return v;
}

version (DeimosOpenSSLTest)
{
static assert(parseOpenSSLVersion("0.9.3") == OpenSSLVersionStruct("0.9.3", 0, 9, 3));
static assert(parseOpenSSLVersion("3.0.10") == OpenSSLVersionStruct("3.0.10", 3, 0, 10));
static assert(parseOpenSSLVersion("1.1.1v") == OpenSSLVersionStruct("1.1.1v", 1, 1, 1, 22));
static assert(parseOpenSSLVersion("1.1.1o-freebsd") == OpenSSLVersionStruct("1.1.1o-freebsd", 1, 1, 1, 15));
}

/* Numeric release version identifier:
* MNNFFPPS: major minor fix patch status
* The status nibble has one of the values 0 for development, 1 to e for betas
Expand Down

0 comments on commit da92bb3

Please sign in to comment.