fix short_version case priority

This commit is contained in:
Houston4444 2025-04-11 10:47:40 +02:00
parent 7e8230c3be
commit 4349839c72

View file

@ -119,19 +119,19 @@ short_version (string orig, string::size_type target_length)
orig.replace (pos, 1, ""); orig.replace (pos, 1, "");
} }
/* remove upper-case vowels, starting at end */ /* remove lower-case consonants, starting at end */
while (orig.length() > target_length) { while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("AEIOU"))) == string::npos) { if ((pos = orig.find_last_of (_("bcdfghjklmnpqrtvwxyz"))) == string::npos) {
break; break;
} }
orig.replace (pos, 1, ""); orig.replace (pos, 1, "");
} }
/* remove lower-case consonants, starting at end */ /* remove upper-case vowels, starting at end */
while (orig.length() > target_length) { while (orig.length() > target_length) {
if ((pos = orig.find_last_of (_("bcdfghjklmnpqrtvwxyz"))) == string::npos) { if ((pos = orig.find_last_of (_("AEIOU"))) == string::npos) {
break; break;
} }
orig.replace (pos, 1, ""); orig.replace (pos, 1, "");