Fix regression in version string parsing (#563)

This commit is contained in:
LemonBoy 2019-02-14 10:15:52 +01:00
commit 1678142723

View file

@ -189,7 +189,7 @@ proc parseVersionRange*(s: string): VersionRange =
of ' ': of ' ':
# Make sure '0.9 8.03' is not allowed. # Make sure '0.9 8.03' is not allowed.
if version != "" and i < s.len: if version != "" and i < s.len - 1:
if s[i+1] in {'0'..'9', '.'}: if s[i+1] in {'0'..'9', '.'}:
raise newException(ParseVersionError, raise newException(ParseVersionError,
"Whitespace is not allowed in a version literal.") "Whitespace is not allowed in a version literal.")