]> granicus.if.org Git - icinga2/commitdiff
Fix plural name for the Array type
authorGunnar Beutner <gunnar@beutner.name>
Sun, 1 Nov 2015 09:35:08 +0000 (10:35 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Sun, 1 Nov 2015 09:35:31 +0000 (10:35 +0100)
fixes #10501

lib/base/type.cpp

index b084cb80720d61f8277072e59ad37724033a0530..33f6726a19fbcf4216f0d25bffffc7dd9fd3ecaf 100644 (file)
@@ -60,7 +60,8 @@ String Type::GetPluralName(void) const
 {
        String name = GetName();
 
-       if (name[name.GetLength() - 1] == 'y')
+       if (name.GetLength() >= 2 && name[name.GetLength() - 1] == 'y' &&
+           name.SubStr(name.GetLength() - 2, 1).FindFirstOf("aeiou") == String::NPos)
                return name.SubStr(0, name.GetLength() - 1) + "ies";
        else
                return name + "s";