summaryrefslogtreecommitdiffstats
path: root/generic/tclGetDate.y
diff options
context:
space:
mode:
authorkennykb <kennykb@noemail.net>2004-12-29 20:57:24 (GMT)
committerkennykb <kennykb@noemail.net>2004-12-29 20:57:24 (GMT)
commitbfb5407182ecb6762c0f4b1bd305c0f283e68a53 (patch)
tree443fafc914ab6f557d09f08d00406daa7772ee6e /generic/tclGetDate.y
parentcd8637a0f2474450c426af344561a41e13617293 (diff)
downloadtcl-bfb5407182ecb6762c0f4b1bd305c0f283e68a53.zip
tcl-bfb5407182ecb6762c0f4b1bd305c0f283e68a53.tar.gz
tcl-bfb5407182ecb6762c0f4b1bd305c0f283e68a53.tar.bz2
bugs 1090413, 1092789 fixed
FossilOrigin-Name: c237cdd9eca448e03244267b222acb6131c1eacc
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;