summaryrefslogtreecommitdiffstats
path: root/generic/tclGetDate.y
diff options
context:
space:
mode:
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;