Changes On Branch bug-f2b5f89c0d
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch bug-f2b5f89c0d Excluding Merge-Ins

This is equivalent to a diff from b2ae97e2c3 to bb9e3560fd

2024-11-23
12:06
Revert "leapDay" stuff. Too early for 9.0.1. Update documentation check-in: a5b130a5fa user: jan.nijtmans tags: trunk, main
2024-11-22
22:00
Revert "leapDay" stuff. Update documentation Closed-Leaf check-in: bb9e3560fd user: jan.nijtmans tags: bug-f2b5f89c0d
13:19
Rebase to latest 9.0. Better error-handling. Remove unneeded parameter check-in: fc6274015d user: jan.nijtmans tags: bug-a8e4f76ce4
11:15
Remove support for leap-minutes (I thought I already removed that) check-in: b2ae97e2c3 user: jan.nijtmans tags: trunk, main
10:39
Remove support for leap-minutes (I thought I already removed that) check-in: 408183a4a5 user: jan.nijtmans tags: core-8-branch
10:17
Add simple year-check to leap-seconds detection: There were only leap seconds from 1972 - 2016 (whic... check-in: 8672c9ff1b user: jan.nijtmans tags: trunk, main

Changes to changes.md.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19












-








The source code for Tcl is managed by fossil.  Tcl developers coordinate all
changes to the Tcl source code at

> [Tcl Source Code](https://core.tcl-lang.org/tcl/timeline)

Release Tcl 9.0.1 arises from the check-in with tag `core-9-0-1`.

## Changes since Tcl 9.0.0
 - [zlib-8.8, zlib-8.16 fail on Fedora 40, gcc 14.1.1](https://core.tcl-lang.org/tcl/tktview/73d5cb)
 - [regression in tzdata, %z instead of offset TZ-name](https://core.tcl-lang.org/tcl/tktview/2c237b)
 - [Tcl will not start properly if there is an init.tcl file in the current dir](https://core.tcl-lang.org/tcl/tktview/43c94f)
 - [clock scan of leapsecond: wrong result](https://core.tcl-lang.org/tcl/tktview/f2b5f8)
 - [clock scan "24:00", ISO-8601 compatibility](https://core.tcl-lang.org/tcl/tktview/aee9f2)
 - [install registry and dde in $INSTALL_DIR\lib always](https://core.tcl-lang.org/tcl/tktview/364bd9)
 - [cannot build .chm help file (Windows)](https://core.tcl-lang.org/tcl/tktview/bb110c)
 - [TIP 701 - Tcl_FSTildeExpand C API](https://core.tcl-lang.org/tips/doc/trunk/tip/701.md)
 - [buffer overwrite for non-BMP characters in utf-16](https://core.tcl-lang.org/tcl/tktview/66da4d)

Release Tcl 9.0.0 arises from the check-in with tag `core-9-0-0`.
Changes to doc/clock.n.
917
918
919
920
921
922
923
924


925
926
927
928
929
930
931
917
918
919
920
921
922
923

924
925
926
927
928
929
930
931
932







-
+
+







\fItime\fR
.
A time of day, which is of the form:
.QW "\fIhh\fR?\fB:\fImm\fR?\fB:\fIss\fR?? ?\fImeridian\fR? ?\fIzone\fR?"
or
.QW "\fBhhmm \fR?\fBmeridian\fR? ?\fBzone\fR?" .
If no \fImeridian\fR is specified, \fIhh\fR is interpreted on
a 24-hour clock.
a 24-hour clock. The "24:00" and "24:00:00" formats (with or without
colon) are supported only if no \fImeridian\fR is specified.
.TP
\fIdate\fR
.
A specific month and day with optional year.  The
acceptable formats are
.QW "\fImm\fB/\fIdd\fR?\fB/\fIyy\fR?" ,
.QW "\fImonthname dd\fR?\fB, \fIyy\fR?" ,
947
948
949
950
951
952
953
954



955
956
957
958
959
960
961
948
949
950
951
952
953
954

955
956
957
958
959
960
961
962
963
964







-
+
+
+







.QW T ,
.QW "\fICCyymmdd hhmmss\fR" ,
.QW "\fICCyymmdd\fBT\fIhh:mm:ss\fR" ,
or
.QW "\fICCyy-mm-dd\fBT\fIhh:mm:ss\fR" .
Note that only these four formats are accepted.
The command does \fInot\fR accept the full range of point-in-time
specifications specified in ISO8601.  Other formats can be recognized by
specifications specified in ISO8601.  For example, leap seconds are
not supported. The "24:00" and "24:00:00" formats (with or without
colon) are supported.  Other formats can be recognized by
giving an explicit \fB\-format\fR option to the \fBclock scan\fR command.
.TP
\fIrelative time\fR
.
A specification relative to the current time.  The format is \fBnumber
unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR,
\fBmonth\fR, \fBweek\fR, \fBday\fR,
Changes to generic/tclClock.c.
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3781
3782
3783
3784
3785
3786
3787

3788
3789
3790
3791
3792
3793
3794







-







    DateInfo *info,		/* Clock scan info structure */
    ClockFmtScnCmdArgs *opts,	/* Scan options */
    int stage)			/* Stage to validate (1, 2 or 3 for both) */
{
    const char *errMsg = "", *errCode = "";
    TclDateFields temp;
    int tempCpyFlg = 0;
    int leapDay = -1;
    ClockClientData *dataPtr = opts->dataPtr;

#if 0
    printf("yyMonth %d, yyDay %d, yyDayOfYear %d, yyHour %d, yyMinutes %d, yySeconds %" TCL_LL_MODIFIER "d, "
	    "yySecondOfDay %" TCL_LL_MODIFIER "d, sec %" TCL_LL_MODIFIER "d, daySec %" TCL_LL_MODIFIER "d, tzOffset %d\n",
	    yyMonth, yyDay, yydate.dayOfYear, yyHour, yyMinutes, yySeconds,
	    yySecondOfDay, yydate.localSeconds, yydate.localSeconds % SECONDS_PER_DAY,
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3805
3806
3807
3808
3809
3810
3811



3812
3813
3814
3815
3816
3817
3818
3819



3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
















3838
3839
3840
3841
3842
3843
3844
3845


3846
3847
3848
3849
3850
3851
3852







-
-
-








-
-
-


















-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-








-
-







	if ((info->flags & CLF_ISO8601YEAR)) {
	    if (yydate.iso8601Year < dataPtr->validMinYear
		    || yydate.iso8601Year > dataPtr->validMaxYear) {
		errMsg = "invalid iso year";
		errCode = "iso year";
		goto error;
	    }
	    if ((yydate.iso8601Year < 1972) || (yydate.iso8601Year > 2017)) {
		leapDay = 0;
	    }
	}
	if (info->flags & CLF_YEAR) {
	    if (yyYear < dataPtr->validMinYear
		    || yyYear > dataPtr->validMaxYear) {
		errMsg = "invalid year";
		errCode = "year";
		goto error;
	    }
	    if ((yyYear < 1972) || (yyYear > 2017)) {
		leapDay = 0;
	    }
	} else if ((info->flags & CLF_ISO8601YEAR)) {
	    yyYear = yydate.iso8601Year; /* used to recognize leap */
	}
	if ((info->flags & (CLF_ISO8601YEAR | CLF_YEAR))
		== (CLF_ISO8601YEAR | CLF_YEAR)) {
	    if (yyYear != yydate.iso8601Year) {
		errMsg = "ambiguous year";
		errCode = "year";
		goto error;
	    }
	}
    }
    /* and month (used later in hath) */
    if (info->flags & CLF_MONTH) {
	if (yyMonth < 1 || yyMonth > 12) {
	    errMsg = "invalid month";
	    errCode = "month";
	    goto error;
	} else if (leapDay) {
	    switch (yyMonth) {
	    case 6:
		leapDay = 30;
		break;
	    case 12:
		leapDay = 31;
		break;
	    case 1:
	    case 7:
		leapDay = 1;
		break;
	    default:
		leapDay = 0;
		break;
	    }
	}
    }
    /* day of month */
    if (info->flags & (CLF_DAYOFMONTH|CLF_DAYOFWEEK)) {
	if (yyDay < 1 || yyDay > 31) {
	    errMsg = "invalid day";
	    errCode = "day";
	    goto error;
	} else if ((leapDay > 0) && (info->flags & CLF_DAYOFMONTH) && (yyDay != leapDay)) {
	    leapDay = 0;
	}
	if ((info->flags & CLF_MONTH)) {
	    const int *h = hath[IsGregorianLeapYear(&yydate)];

	    if (yyDay > h[yyMonth - 1]) {
		errMsg = "invalid day";
		errCode = "day";
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924

3925
3926
3927
3928
3929
3930
3931
3880
3881
3882
3883
3884
3885
3886


3887
3888
3889
3890
3891
3892


3893
3894

3895
3896
3897
3898
3899
3900
3901
3902







-
-






-
-


-
+








    if (info->flags & CLF_TIME) {
	/* hour */
	if (yyHour < 0 || yyHour > ((yyMeridian == MER24) ? 24 : 12)) {
	    errMsg = "invalid time (hour)";
	    errCode = "hour";
	    goto error;
	} else if (yyHour == 24) {
	    leapDay = 0;
	}
	/* minutes */
	if (yyMinutes < 0 || yyMinutes > 59 || (yyMinutes && (yyHour == 24))) {
	    errMsg = "invalid time (minutes)";
	    errCode = "minutes";
	    goto error;
	} else if ((yyMinutes % 15) != 14) {
	    leapDay = 0;
	}
	/* oldscan could return secondOfDay (parsedTime) -1 by invalid time (ex.: 25:00:00) */
	if (yySeconds < 0 || yySeconds > (leapDay ? 60 : 59) || yySecondOfDay <= -1 || (yySeconds && (yyHour == 24))) {
	if (yySeconds < 0 || yySeconds > 59 || yySecondOfDay <= -1 || (yySeconds && (yyHour == 24))) {
	    errMsg = "invalid time";
	    errCode = "seconds";
	    goto error;
	}
    }

    if (!(stage & CLF_VALIDATE_S2) || !(opts->flags & CLF_VALIDATE_S2)) {
Changes to tests/clock.test.
38457
38458
38459
38460
38461
38462
38463
38464
38465
38466

38467
38468
38469
38470
38471
38472
38473
38474
38475
38476
38477
38478

38479
38480

38481
38482
38483
38484
38485
38486
38487
38488

38489
38490

38491
38492
38493
38494
38495
38496
38497
38457
38458
38459
38460
38461
38462
38463

38464

38465
38466
38467
38468
38469
38470
38471
38472
38473
38474
38475
38476

38477


38478
38479
38480
38481
38482
38483
38484
38485
38486
38487
38488

38489
38490
38491
38492
38493
38494
38495
38496







-

-
+











-
+
-
-
+








+

-
+







	}
    }
    set res; # must be empty
} -result {}
test clock-68.1a {Leap second, minute, hour [f2b5f89c0d], regression test (validity check)} -body {
    set res {}
    foreach {d i} {
	"2012-06-30 23:59:60" 1341100800
	"2012-06-30 24:00:00" 1341100800
    } {
        } {
	# check with free scan:
	if {[set t [clock scan $d -gmt 1]] != $i} {
	    lappend res "free-scan \"$d\" == $t, expected $i"
	}
	# check with formatted scan:
	if {[set t [clock scan $d -gmt 1 -format "%Y-%m-%d %H:%M:%S"]] != $i} {
	    lappend res "fmt-scan \"$d\" == $t, expected $i"
	}
    }
    set res; # must be empty
} -result {}
test clock-68.2 {Leap second, minute, hour [f2b5f89c0d], regression test (validity check)} -constraints !valid_off -body {
test clock-68.2 {Leap second, "24:00", regression test (validity check)} -constraints !valid_off -body {
    # regardless solution for [f2b5f89c0d], this conversions must fail on -valid 1 (constraints !valid_off),
    # because of wrong day and month for the leap second. There were only leap seconds from 1972 - 2016:
    # Leap seconds are not supported. "24:00" is supported.
    set res {}
    foreach {d i} {
	"2012-06-29 23:59:60" "invalid time"
	"2012-05-30 23:59:60" "invalid time"
	"2012-05-30 23:60:60" "invalid time"
	"2012-05-30 24:00:01" "invalid time"
	"2012-05-30 24:01:00" "invalid time"
	"1971-06-30 23:59:60" "invalid time"
	"2012-06-30 23:59:60" "invalid time"
	"2018-06-30 23:59:60" "invalid time"
    } {
        } {
	# check with free scan:
	if {![catch { clock scan $d -gmt 1 } t] || ![string match *$i* $t]} {
	    lappend res "free-scan \"$d\" == \"$t\", expected \"$i\""
	}
	# check with formatted scan:
	if {![catch { clock scan $d -gmt 1 -format "%Y-%m-%d %H:%M:%S" } t] || ![string match *$i* $t]} {
	    lappend res "fmt-scan \"$d\" == \"$t\", expected \"$i\""