From: Gunnar Beutner Date: Sun, 1 Nov 2015 09:35:08 +0000 (+0100) Subject: Fix plural name for the Array type X-Git-Tag: v2.4.0~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2829ca5223402fb3c5a38cb89e68adf0c5127d9;p=icinga2 Fix plural name for the Array type fixes #10501 --- diff --git a/lib/base/type.cpp b/lib/base/type.cpp index b084cb807..33f6726a1 100644 --- a/lib/base/type.cpp +++ b/lib/base/type.cpp @@ -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";