From 449b53e34a687005eeba239f2ead360bd65c1b5a Mon Sep 17 00:00:00 2001 From: Marko Karppinen Date: Thu, 24 Jan 2002 22:24:58 +0000 Subject: [PATCH] Ignore ordinal suffixes on numbers (bug #15210) --- ext/standard/parsedate.y | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ext/standard/parsedate.y b/ext/standard/parsedate.y index 84ee81356c..7112b611b7 100644 --- a/ext/standard/parsedate.y +++ b/ext/standard/parsedate.y @@ -862,6 +862,16 @@ yylex () yyInput--; if (sign < 0) yylval.Number = -yylval.Number; + /* Ignore ordinal suffixes on numbers */ + c = *yyInput; + if (c == 's' || c == 'n' || c == 'r' || c == 't') { + c = *++yyInput; + if (c == 't' || c == 'd' || c == 'h') { + yyInput++; + } else { + yyInput--; + } + } return sign ? tSNUMBER : tUNUMBER; } if (ISALPHA (c)) -- 2.50.1