cvs: /php3/functions parsedate.y

From: Date: Tue, 13 Jul 1999 09:14:28 +0000
Subject: cvs: /php3/functions parsedate.y
Groups: php.dev 
Request: Send a blank email to php-dev+get-8430@lists.php.net to get a copy of this message
andrey Tue Jul 13 09:14:28 1999 EDT Modified files: /php3/functions parsedate.y Log: Some fixes. Index: php3/functions/parsedate.y diff -u php3/functions/parsedate.y:1.5 php3/functions/parsedate.y:1.6 --- php3/functions/parsedate.y:1.5 Mon Jul 12 17:15:12 1999 +++ php3/functions/parsedate.y Tue Jul 13 09:14:28 1999 @@ -1,5 +1,5 @@ %{ -/* $Revision: 1.5 $ +/* $Revision: 1.6 $ ** ** Originally written by Steven M. Bellovin <smb@research.att.com> while ** at the University of North Carolina at Chapel Hill. Later tweaked by @@ -18,20 +18,14 @@ /* SUPPRESS 593 on yynewstate *//* Label was not used */ /* SUPPRESS 595 on yypvt *//* Automatic variable may be used before set */ +#include "config.h" #include <stdio.h> #include <sys/types.h> -/* -#include "configdata.h" -#include "clibrary.h"*/ -#if defined(DO_NEED_TIME) #include <time.h> -#endif /* defined(DO_NEED_TIME) */ #ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif #include <ctype.h> -/*#include "libinn.h" -#include "macros.h"*/ #if defined(_HPUX_SOURCE) #include <alloca.h> @@ -267,22 +261,22 @@ } | tUNUMBER '/' tUNUMBER '/' tUNUMBER { if ($1 > 100) { - /* assume YYYY/MM/DD format, so need not to add 1900 */ - yyYear = $1; - yyMonth = $3; - yyDay = $5; + /* assume YYYY/MM/DD format, so need not to add 1900 */ + yyYear = $1; + yyMonth = $3; + yyDay = $5; } else { - /* assume MM/DD/YY* format */ - yyMonth = $1; - yyDay = $3; - if ($5 > 100) { - /* assume year is YYYY format, so need not to add 1900 */ - yyYear = $5; - } else { - /* assume year is YY format, so need to add 1900 */ - yyYear = $5 + 1900; - } + /* assume MM/DD/YY* format */ + yyMonth = $1; + yyDay = $3; + if ($5 > 100) { + /* assume year is YYYY format, so need not to add 1900 */ + yyYear = $5; + } else { + /* assume year is YY format, so need to add 1900 */ + yyYear = $5 + 1900; + } } } | tMONTH tUNUMBER {

« previous php.dev (#8430) next »