Skip to content
Snippets Groups Projects
Commit f5c1c97d authored by Florian Fischer's avatar Florian Fischer
Browse files

LinuxVersion: fix compare of versions with not the same amount of parts

LinuxVersion::compare reported two versions as equal if it could
find a new '.' in the first version but not in the second.
But this is clearly wrong because it skips comparision of the valid last
part.

The comparision 5.16.12 >= 5.18 returned true because compare
reported the version as equal after comparing the first parts and
finding a second '.' in the first but not the second.

Fix this behavior by marking the current position as the last but
do not skip its comparision.

Add tests for the desired behaviour.
parent 8ae1f189
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment