Remove unused plurize()

Unused since commit 44c36fa, v4.3.23.
This commit is contained in:
Markus Armbruster 2010-07-18 15:14:41 +02:00
parent 13d236a1e0
commit 91302d36dd
2 changed files with 0 additions and 30 deletions

View file

@ -337,8 +337,6 @@ extern char *numstr(char buf[], int n);
extern char *esplur(int n);
extern char *splur(int n);
extern char *iesplur(int n);
extern char *plurize(char *buf, int max_len, int n);
/* more in misc.h */
/*
* src/lib/global/ *.c

View file

@ -52,31 +52,3 @@ iesplur(int n)
{
return n == 1 ? "y" : "ies";
}
/*
* Change suffix of BUF to English plural if N > 1.
* Best effort, not 100% accurate English.
* Array BUF[SIZE] contains a zero-terminated string.
* If there's not enough space for changed suffix, it is truncated.
*/
char *
plurize(char *buf, int size, int n)
{
size_t len = strlen(buf);
if (!len || n <= 1)
return buf;
switch (buf[len - 1]) {
case 'y':
buf[len - 1] = '\0';
strncat(buf, "ies", size - len);
break;
case 's':
strncat(buf, "es", size - len - 1);
break;
default:
strncat(buf, "s", size - len - 1);
}
return buf;
}