From: Volker Schatz Date: Tue, 3 Jun 2008 21:52:04 +0000 (+0200) Subject: ddate: 11th, 12th and 13th of month X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eab17b95d813c93c8e7b5e7f5943f0940420f00;p=util-linux ddate: 11th, 12th and 13th of month the Discordian date utility ddate gives the 11th, 12th and 13th of the month as the "11st", "12nd" and "13rd". Unless this is a religious thing, please apply the patch below. Signed-off-by: Volker Schatz --- diff --git a/misc-utils/ddate.c b/misc-utils/ddate.c index 1f488aa6..df6b3718 100644 --- a/misc-utils/ddate.c +++ b/misc-utils/ddate.c @@ -130,7 +130,7 @@ default_fmt #define DY(y) (y+1166) static inline char *ending(int i) { - return (i%10==1)?"st":(i%10==2?"nd":(i%10==3?"rd":"th")); + return i/10==1?"th":(i%10==1?"st":(i%10==2?"nd":(i%10==3?"rd":"th"))); } static inline int leapp(int i) {