keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
377 stars 104 forks source link

bug(linux): Fix version comparison in `keymanutil.c` #9593

Closed ermshiperete closed 5 months ago

ermshiperete commented 9 months ago

keymanutil.c contains at least one comparison of versions. This currently uses string comparison which doesn't work very well for version numbers, e.g. 1.9 and 1.10.

One scenario where a user would notice this, is if he has version 1.9 of a keyboard installed in the shared area. He then installs version 1.10 (which adds language X) into the user area. Until this bug is fixed the keyboard won't show up as keyboard for X.

mcdurdin commented 9 months ago

I think this should be addressed sooner rather than later, because it has broken on other platforms in the past.

It should be relatively easy to fix, e.g. see:

They may not all be optimally written, but they do work.

Sample C++ implementation that uses standard libraries: