summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/libutil.cc')
-rw-r--r--crawl-ref/source/libutil.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index 1b4826c8ca..0175291628 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -15,6 +15,7 @@
#include "defines.h"
#include "directn.h"
#include "initfile.h"
+#include "itemname.h" // is_vowel()
#include "libutil.h"
#include "externs.h"
#include "macro.h"
@@ -332,7 +333,14 @@ std::string pluralise(const std::string &name,
}
else if (ends_with(name, "y"))
{
- return name.substr(0, name.length() - 1) + "ies";
+ if (name == "y")
+ return ("ys");
+ // day -> days, boy -> boys, etc
+ else if (is_vowel(name[name.length() - 2]))
+ return name + "s";
+ // jelly -> jellies
+ else
+ return name.substr(0, name.length() - 1) + "ies";
}
else if (ends_with(name, "fe"))
{