summaryrefslogtreecommitdiffstats
path: root/generic/tclGetDate.y
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2004-12-29 20:57:25 (GMT)
committerKevin B Kenny <kennykb@acm.org>2004-12-29 20:57:25 (GMT)
commitf68ab6508b8355f713be6c3005204bbab14717aa (patch)
tree443fafc914ab6f557d09f08d00406daa7772ee6e /generic/tclGetDate.y
parent3c1e7bd70247b897a1e6f47d8fcb6d50de880aea (diff)
downloadtcl-f68ab6508b8355f713be6c3005204bbab14717aa.zip
tcl-f68ab6508b8355f713be6c3005204bbab14717aa.tar.gz
tcl-f68ab6508b8355f713be6c3005204bbab14717aa.tar.bz2
bugs 1090413, 1092789 fixed
Diffstat (limited to 'generic/tclGetDate.y')
-rw-r--r--generic/tclGetDate.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y
index 3d04714..0be34be 100644
--- a/generic/tclGetDate.y
+++ b/generic/tclGetDate.y
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclGetDate.y,v 1.25 2004/09/27 14:31:17 kennykb Exp $
+ * RCS: @(#) $Id: tclGetDate.y,v 1.26 2004/12/29 20:57:27 kennykb Exp $
*/
%{
@@ -77,6 +77,8 @@ typedef struct DateInfo {
char *dateInput;
time_t *dateRelPointer;
+ int dateDigitCount;
+
} DateInfo;
#define YYPARSE_PARAM info
@@ -105,6 +107,7 @@ typedef struct DateInfo {
#define yyRelSeconds (((DateInfo*)info)->dateRelSeconds)
#define yyRelPointer (((DateInfo*)info)->dateRelPointer)
#define yyInput (((DateInfo*)info)->dateInput)
+#define yyDigitCount (((DateInfo*)info)->dateDigitCount)
#define EPOCH 1970
#define START_OF_TIME 1902
@@ -407,7 +410,7 @@ number : tUNUMBER
yyYear = $1;
} else {
yyHaveTime++;
- if ($1 < 100) {
+ if (yyDigitCount <= 2) {
yyHour = $1;
yyMinutes = 0;
} else {
@@ -801,6 +804,7 @@ TclDatelex( void* info )
Count++;
}
yyInput--;
+ yyDigitCount = Count;
/* A number with 6 or more digits is considered an ISO 8601 base */
if (Count >= 6) {
return tISOBASE;