summaryrefslogtreecommitdiffstats
path: root/generic/tclDate.c
diff options
context:
space:
mode:
authorericm <ericm@noemail.net>2000-02-28 18:49:41 (GMT)
committerericm <ericm@noemail.net>2000-02-28 18:49:41 (GMT)
commit9a0d541ca86aa2dff1d0b5a89e0ebaa3a27f815f (patch)
treef803022cc88ec472d9771e6a7bb8f45259d814f3 /generic/tclDate.c
parent01aa0076aa99ebc2e943110ad6d269f8e599133d (diff)
downloadtcl-9a0d541ca86aa2dff1d0b5a89e0ebaa3a27f815f.zip
tcl-9a0d541ca86aa2dff1d0b5a89e0ebaa3a27f815f.tar.gz
tcl-9a0d541ca86aa2dff1d0b5a89e0ebaa3a27f815f.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. FossilOrigin-Name: 7f9ecc28cace61f690eaad6a39ed86f5b5b0d0d8
Diffstat (limited to 'generic/tclDate.c')
-rw-r--r--generic/tclDate.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclDate.c b/generic/tclDate.c
index 5e36665..02a82c7 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDate.c,v 1.16 2000/02/09 03:56:24 ericm Exp $
+ * RCS: @(#) $Id: tclDate.c,v 1.17 2000/02/28 18:49:42 ericm Exp $
*/
#include "tclInt.h"
@@ -765,12 +765,16 @@ TclDatelex()
}
if (isdigit(UCHAR(c = *TclDateInput))) { /* INTL: digit */
+ /* convert the string into a number; count the number of digits */
+ Count = 0;
for (TclDatelval.Number = 0;
isdigit(UCHAR(c = *TclDateInput++)); ) { /* INTL: digit */
TclDatelval.Number = 10 * TclDatelval.Number + c - '0';
+ Count++;
}
TclDateInput--;
- if (TclDatelval.Number >= 100000) {
+ /* A number with 6 or more digits is considered an ISO 8601 base */
+ if (Count >= 6) {
return tISOBASE;
} else {
return tUNUMBER;