Skip to content
Snippets Groups Projects
  • Florian Fischer's avatar
    f5c1c97d
    LinuxVersion: fix compare of versions with not the same amount of parts · f5c1c97d
    Florian Fischer authored
    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.
    f5c1c97d
    History
    LinuxVersion: fix compare of versions with not the same amount of parts
    Florian Fischer authored
    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.