1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

In messages, use singular nouns for -1, like we do for +1.

This outputs "-1 year", not "-1 years".

Reported-by: neverov.max@gmail.com

Bug: 16939

Discussion: https://postgr.es/m/16939-cceeb03fb72736ee@postgresql.org
This commit is contained in:
Bruce Momjian
2021-03-30 18:34:27 -04:00
parent 6131ffc43f
commit 5da9868ed9
4 changed files with 17 additions and 17 deletions

View File

@ -4190,7 +4190,7 @@ AddPostgresIntPart(char *cp, int value, const char *units,
(*is_before && value > 0) ? "+" : "",
value,
units,
(value != 1) ? "s" : "");
(abs(value) != 1) ? "s" : "");
/*
* Each nonzero field sets is_before for (only) the next one. This is a
@ -4216,7 +4216,7 @@ AddVerboseIntPart(char *cp, int value, const char *units,
}
else if (*is_before)
value = -value;
sprintf(cp, " %d %s%s", value, units, (value == 1) ? "" : "s");
sprintf(cp, " %d %s%s", value, units, (abs(value) == 1) ? "" : "s");
*is_zero = false;
return cp + strlen(cp);
}