Fix version qualifier comparison

When comparing qualifiers of different lengths, if all the characters
match but the end of one qualifier is reached, finish off the
comparison using the qualifier lengths.

[#50968219]
Merge 50968219- to master

[Completes #50968219]