Skip to content

Commit

Permalink
fix: handle - and _ in versions
Browse files Browse the repository at this point in the history
  • Loading branch information
terriko committed Oct 25, 2023
1 parent 8bc2613 commit 6814d4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cve_bin_tool/version_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ def parse_version(version_string: str):
versionString = version_string
versionArray = []

# Attempt a split based on common whitespace delimiters
# convert - and _ to be treated like . below
# we could switch to a re split but it seems to leave blanks so this is less hassle
versionString = versionString.replace("-", ".")
versionString = versionString.replace("_", ".")

# Attempt a split
split_version = versionString.split(".")

# if the whole string was numeric then we're done and you can move on
Expand Down

0 comments on commit 6814d4d

Please sign in to comment.