summaryrefslogtreecommitdiffstats
path: root/generic/tclGetDate.y
diff options
context:
space:
mode:
authorericm <ericm>2000-02-28 18:49:41 (GMT)
committerericm <ericm>2000-02-28 18:49:41 (GMT)
commitd1edd68524561d9f8c25de1d4a095eaf4a09f55a (patch)
treef803022cc88ec472d9771e6a7bb8f45259d814f3 /generic/tclGetDate.y
parente411cd157324b6c27b10548c0b50704a7cbf4b37 (diff)
downloadtcl-d1edd68524561d9f8c25de1d4a095eaf4a09f55a.zip
tcl-d1edd68524561d9f8c25de1d4a095eaf4a09f55a.tar.gz
tcl-d1edd68524561d9f8c25de1d4a095eaf4a09f55a.tar.bz2
* tests/clock.test: Added test for ISO bases < 100000
* generic/tclDate.c: (generated on Solaris) * generic/tclGetDate.y: Changed condition for deciding if a number is an ISO 8601 base from number >= 100000 to numberOfDigits >= 6. Previously it would fail to recognize 000000 as an ISO base.
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 c5347bb..f34cb9c 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.14 2000/02/09 03:56:24 ericm Exp $
+ * RCS: @(#) $Id: tclGetDate.y,v 1.15 2000/02/28 18:49:42 ericm Exp $
*/
%{
@@ -980,12 +980,16 @@ yylex()
}
if (isdigit(UCHAR(c = *yyInput))) { /* INTL: digit */
+ /* convert the string into a number; count the number of digits */
+ Count = 0;
for (yylval.Number = 0;
isdigit(UCHAR(c = *yyInput++)); ) { /* INTL: digit */
yylval.Number = 10 * yylval.Number + c - '0';
+ Count++;
}
yyInput--;
- if (yylval.Number >= 100000) {
+ /* A number with 6 or more digits is considered an ISO 8601 base */
+ if (Count >= 6) {
return tISOBASE;
} else {
return tUNUMBER;