diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2021-06-27 11:26:36 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2021-06-27 11:26:36 (GMT) |
commit | a855be143c2724dd0f4b899272ea78a1440a542e (patch) | |
tree | 02e1a22fe92da682f2026f9a4f74422b8e75d645 | |
parent | 5e07595538f97ed858b9b0b68e8c2884c5cb76e9 (diff) | |
parent | 25a30f2db04d9d60b0279cbeab73acaeb42aa1ca (diff) | |
download | tcl-a855be143c2724dd0f4b899272ea78a1440a542e.zip tcl-a855be143c2724dd0f4b899272ea78a1440a542e.tar.gz tcl-a855be143c2724dd0f4b899272ea78a1440a542e.tar.bz2 |
merge core-8-branch
-rw-r--r-- | .github/ISSUE_TEMPLATE.md | 2 | ||||
-rw-r--r-- | .github/PULL_REQUEST_TEMPLATE.md | 2 | ||||
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | ChangeLog.2004 | 2 | ||||
-rw-r--r-- | ChangeLog.2007 | 2 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | changes | 10 | ||||
-rw-r--r-- | doc/clock.n | 4 | ||||
-rw-r--r-- | doc/cookiejar.n | 4 | ||||
-rw-r--r-- | doc/dde.n | 2 | ||||
-rw-r--r-- | doc/tm.n | 4 | ||||
-rw-r--r-- | generic/tcl.h | 2 | ||||
-rw-r--r-- | generic/tclBasic.c | 24 | ||||
-rw-r--r-- | generic/tclEncoding.c | 2 | ||||
-rw-r--r-- | generic/tclExecute.c | 1 | ||||
-rw-r--r-- | generic/tclInt.h | 5 | ||||
-rw-r--r-- | generic/tclLoad.c | 6 | ||||
-rw-r--r-- | generic/tclZipfs.c | 2 | ||||
-rw-r--r-- | tests/chanio.test | 8 | ||||
-rw-r--r-- | tests/coroutine.test | 71 | ||||
-rw-r--r-- | tests/encoding.test | 15 | ||||
-rw-r--r-- | tools/encoding/iso8859-7.txt | 2 | ||||
-rw-r--r-- | unix/Makefile.in | 4 | ||||
-rw-r--r-- | unix/README | 6 | ||||
-rw-r--r-- | unix/tcl.pc.in | 2 | ||||
-rw-r--r-- | unix/tcl.spec | 2 | ||||
-rw-r--r-- | unix/tclKqueueNotfy.c | 5 | ||||
-rw-r--r-- | win/README | 9 | ||||
-rw-r--r-- | win/nmakehlp.c | 44 | ||||
-rw-r--r-- | win/tclWinFile.c | 2 |
30 files changed, 183 insertions, 67 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 22d3860..60c8cbb 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,3 +1,3 @@ Important Note ========== -Please do not file issues with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues are hosted in the [tcl fossil repository on core.tcl.tk](https://core.tcl.tk/tcl/tktnew); please post them there. +Please do not file issues with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues are hosted in the [tcl fossil repository on core.tcl-lang.org](https://core.tcl-lang.org/tcl/tktnew); please post them there. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index da07cd2..d98ff0e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,3 @@ Important Note ========== -Please do not file pull requests with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues (including patches) are hosted in the [tcl fossil repository on core.tcl.tk](https://core.tcl.tk/tcl/tktnew); please post them there. +Please do not file pull requests with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues (including patches) are hosted in the [tcl fossil repository on core.tcl-lang.org](https://core.tcl-lang.org/tcl/tktnew); please post them there. @@ -8096,7 +8096,7 @@ a better first place to look now. 2009-03-25 Jan Nijtmans <nijtmans@users.sf.net> * doc/tclsh.1: Bring doc and tools in line with - * tools/installData.tcl: http://wiki.tcl.tk/812 + * tools/installData.tcl: https://wiki.tcl-lang.org/page/exec+magic * tools/str2c * tools/tcltk-man2html.tcl diff --git a/ChangeLog.2004 b/ChangeLog.2004 index f7da18d..550e286 100644 --- a/ChangeLog.2004 +++ b/ChangeLog.2004 @@ -345,7 +345,7 @@ * library/clock.tcl: Corrected the regular expressions that match a time zone to allow for time zones specified as +HH or -HH. * tests/clock.test: Added regression test case for the above issue. - Thanks to Rolf Ade for reporting this issue [http://wiki.tcl.tk/13094] + Thanks to Rolf Ade for reporting this issue [https://wiki.tcl-lang.org/page/Parsing+ISO8601+dates+and+times] * win/tclWinDde.c (Tcl_DdeObjCmd): Corrected a typo that caused a compilation failure on VC++. diff --git a/ChangeLog.2007 b/ChangeLog.2007 index 34725e3..b01db6a 100644 --- a/ChangeLog.2007 +++ b/ChangeLog.2007 @@ -5262,7 +5262,7 @@ * generic/tclStrToD.c: Added code to support the "middle endian" floating point format used in the Nokia N770's software-based floating point. Thanks to Bruce Johnson for reporting this bug, originally on - http://wiki.tcl.tk/15408. + https://wiki.tcl-lang.org/page/Nokia+770. * library/clock.tcl: Fixed a bug with Daylight Saving Time and Posix time zone specifiers reported by Martin Lemburg in http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/9a8b15a4dfc0b7a0 @@ -45,7 +45,7 @@ and selling it either in whole or in part. See the file ## <a id="doc">2.</a> Documentation Extensive documentation is available on our website. The home page for this release, including new features, is -[here](https://www.tcl.tk/software/tcltk/8.7.html). +[here](https://www.tcl-lang.org/software/tcltk/8.7.html). Detailed release notes can be found at the [file distributions page](https://sourceforge.net/projects/tcl/files/Tcl/) by clicking on the relevant version. @@ -96,7 +96,7 @@ Tcl Dev Kit builds on the earlier TclPro toolset and provides a debugger, static code checker, single-file wrapping utility, bytecode compiler, and more. More information can be found at - http://www.ActiveState.com/Tcl + https://www.activestate.com/products/tcl/ ## <a id="complangtcl">5.</a> Tcl newsgroup There is a USENET newsgroup, "`comp.lang.tcl`", intended for the exchange of @@ -8843,7 +8843,7 @@ in this changeset (new minor version) rather than bug fixes: 2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter) ---- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details +--- Released 8.7a1, September 8, 2017 --- https://core.tcl-lang.org/tcl/ for details 2017-08-10 [array names -regexp] supports backrefs (goth) @@ -8942,7 +8942,7 @@ in this changeset (new minor version) rather than bug fixes: 2018-11-16 (bug)[00d04c] Repair [binary encode base64] (sebres) -- Released 8.6.9, November 16, 2018 - details at http://core.tcl-lang.org/tcl/ - +- Released 8.6.9, November 16, 2018 - details at https://core.tcl-lang.org/tcl/ - 2018-11-22 (bug)[7a9dc5] [file normalize ~/~foo] segfault (sebres) @@ -8990,7 +8990,7 @@ in this changeset (new minor version) rather than bug fixes: 2019-11-15 (bug)[135804] segfault in [next] after destroy (coulter,sebres) -- Released 8.6.10, Nov 21, 2019 - details at http://core.tcl-lang.org/tcl/ - +- Released 8.6.10, Nov 21, 2019 - details at https://core.tcl-lang.org/tcl/ - 2019-12-03 (bug)[3cd9be] Corner case in surrogate handling (nijtmans) @@ -9119,7 +9119,7 @@ See RFC 2045 2020-12-23 tzdata updated to Olson's tzdata2020e (jima) -- Released 8.6.11, Dec 31, 2020 - details at http://core.tcl-lang.org/tcl/ - +- Released 8.6.11, Dec 31, 2020 - details at https://core.tcl-lang.org/tcl/ - Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10, plus the following, which focuses on the high-level feature changes @@ -9303,7 +9303,7 @@ in this changeset (new minor version) rather than bug fixes: 2020-12-07 [TIP 590] Recommend lowercase Package Names -2021-01-06 Bump to tcltest 2.5.4 +2021-01-06 Bump to tcltest 2.5.4 2021-01-15 [TIP 481] `Tcl_GetStringFromObj()` with `size_t` length parameter diff --git a/doc/clock.n b/doc/clock.n index 6b15fba..3c71f1e 100644 --- a/doc/clock.n +++ b/doc/clock.n @@ -823,7 +823,7 @@ the minus sign one west of Greenwich. A time zone string conforming to the Posix specification of the \fBTZ\fR environment variable will be recognized. The specification may be found at -\fIhttp://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html\fR. +\fIhttps://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html\fR. .PP If the Posix time zone string contains a DST (Daylight Savings Time) part, but doesn't contain a rule stating when DST starts or ends, @@ -847,7 +847,7 @@ to use it as a location name, as above. .SH "LOCALIZATION" .PP Developers wishing to localize the date and time formatting and parsing -are referred to \fIhttp://tip.tcl.tk/173\fR for a +are referred to \fIhttps://tip.tcl-lang.org/173\fR for a specification. .SH "FREE FORM SCAN" .PP diff --git a/doc/cookiejar.n b/doc/cookiejar.n index 0d8b81a..7d2f46b 100644 --- a/doc/cookiejar.n +++ b/doc/cookiejar.n @@ -182,7 +182,7 @@ set cookiedb ~/.tclcookies.db http::configure -cookiejar [\fBhttp::cookiejar new\fR $cookiedb] # No further explicit steps are required to use cookies -set tok [http::geturl http://core.tcl.tk/] +set tok [http::geturl http://core.tcl-lang.org/] .CE .PP To only allow a particular domain to use cookies, perhaps because you only @@ -205,7 +205,7 @@ set cookiedb ~/.tclcookies.db http::configure -cookiejar [MyCookieJar new $cookiedb] # No further explicit steps are required to use cookies -set tok [http::geturl http://core.tcl.tk/] +set tok [http::geturl http://core.tcl-lang.org/] .CE .SH "SEE ALSO" http(n), oo::class(n), sqlite3(n) @@ -172,7 +172,7 @@ particularly important website: .PP .CS package require dde -\fBdde execute\fR -async iexplore WWW_OpenURL http://www.tcl.tk/ +\fBdde execute\fR -async iexplore WWW_OpenURL http://www.tcl-lang.org/ .CE .SH "SEE ALSO" tk(n), winfo(n), send(n) @@ -298,9 +298,9 @@ environment variables: .SH "SEE ALSO" package(n), Tcl Improvement Proposal #189 .QW "\fITcl Modules\fR" -(online at http://tip.tcl.tk/189.html), Tcl Improvement Proposal #190 +(online at https://tip.tcl-lang.org/189.html), Tcl Improvement Proposal #190 .QW "\fIImplementation Choices for Tcl Modules\fR" -(online at http://tip.tcl.tk/190.html) +(online at https://tip.tcl-lang.org/190.html) .SH "KEYWORDS" modules, package .\" Local Variables: diff --git a/generic/tcl.h b/generic/tcl.h index 67ed6ff..2d529b7 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2479,7 +2479,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv); ++(objPtr)->refCount /* * Use do/while0 idiom for optimum correctness without compiler warnings. - * http://c2.com/cgi/wiki?TrivialDoWhileLoop + * https://wiki.c2.com/?TrivialDoWhileLoop */ # undef Tcl_DecrRefCount # define Tcl_DecrRefCount(objPtr) \ diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 86d7960..69194f8 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -4866,6 +4866,7 @@ NRCommand( int result) { Interp *iPtr = (Interp *) interp; + Tcl_Obj *listPtr; iPtr->numLevels--; @@ -4874,7 +4875,10 @@ NRCommand( */ if (data[1] && (data[1] != INT2PTR(1))) { - TclNRAddCallback(interp, TclNRTailcallEval, data[1], NULL, NULL, NULL); + listPtr = (Tcl_Obj *)data[1]; + data[1] = NULL; + + TclNRAddCallback(interp, TclNRTailcallEval, listPtr, NULL, NULL, NULL); } /* OPT ?? @@ -9449,6 +9453,7 @@ TclNRYieldToObjCmd( iPtr->execEnvPtr = corPtr->callerEEPtr; TclSetTailcall(interp, listPtr); + corPtr->yieldPtr = listPtr; iPtr->execEnvPtr = corPtr->eePtr; return TclNRYieldObjCmd(INT2PTR(CORO_ACTIVATE_YIELDM), interp, 1, objv); @@ -9646,6 +9651,22 @@ TclNRCoroutineActivateCallback( */ if (corPtr->stackLevel != stackLevel) { + NRE_callback *runPtr; + + iPtr->execEnvPtr = corPtr->callerEEPtr; + if (corPtr->yieldPtr) { + for (runPtr = TOP_CB(interp); runPtr; runPtr = runPtr->nextPtr) { + if (runPtr->data[1] == corPtr->yieldPtr) { + runPtr->data[1] = NULL; + Tcl_DecrRefCount(corPtr->yieldPtr); + corPtr->yieldPtr = NULL; + break; + } + } + } + iPtr->execEnvPtr = corPtr->eePtr; + + Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot yield: C stack busy", -1)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD", @@ -9661,6 +9682,7 @@ TclNRCoroutineActivateCallback( Tcl_Panic("Yield received an option which is not implemented"); } + corPtr->yieldPtr = NULL; corPtr->stackLevel = NULL; numLevels = iPtr->numLevels; diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 21c254e..9367863 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2280,7 +2280,7 @@ UtfToUtfProc( break; } src += len; - if (!(flags & TCL_ENCODING_UTF)) { + if (!(flags & TCL_ENCODING_UTF) && (ch > 0x3FF)) { if (ch > 0xFFFF) { /* CESU-8 6-byte sequence for chars > U+FFFF */ ch -= 0x10000; diff --git a/generic/tclExecute.c b/generic/tclExecute.c index f9c2954..7e51c0d 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2506,6 +2506,7 @@ TEBCresume( Tcl_IncrRefCount(valuePtr); iPtr->execEnvPtr = corPtr->callerEEPtr; TclSetTailcall(interp, valuePtr); + corPtr->yieldPtr = valuePtr; iPtr->execEnvPtr = corPtr->eePtr; yieldParameter = (PTR2INT(NULL)+1); /*==CORO_ACTIVATE_YIELDM*/ diff --git a/generic/tclInt.h b/generic/tclInt.h index ad9a5c1..05167b7 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1496,6 +1496,11 @@ typedef struct CoroutineData { int nargs; /* Number of args required for resuming this * coroutine; -2 means "0 or 1" (default), -1 * means "any" */ + Tcl_Obj *yieldPtr; /* The command to yield to. Stored here in + * order to reset splice point in + * TclNRCoroutineActivateCallback if the + * coroutine is busy. + */ } CoroutineData; typedef struct ExecEnv { diff --git a/generic/tclLoad.c b/generic/tclLoad.c index ed2be03..7ea1ebd 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -344,7 +344,11 @@ Tcl_LoadObjCmd( pkgGuess += 3; } #endif /* __CYGWIN__ */ - if ((pkgGuess[0] == 't') && (pkgGuess[1] == 'c') + if (((pkgGuess[0] == 't') +#ifdef MAC_OSX_TCL + || (pkgGuess[0] == 'T') +#endif + ) && (pkgGuess[1] == 'c') && (pkgGuess[2] == 'l')) { pkgGuess += 3; } diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 4d43331..c1ba395 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -32,7 +32,7 @@ #define TBLS 1 #endif -#if !defined(NO_DLFCN_H) +#if !defined(_WIN32) && !defined(NO_DLFCN_H) #include <dlfcn.h> #endif diff --git a/tests/chanio.test b/tests/chanio.test index 4e911f9..2d26ac9 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -5511,10 +5511,10 @@ test chan-io-41.5 {Tcl_FileeventCmd: errors} -constraints fileevent -body { } -returnCodes error -result {bad event name "who-knows": must be readable or writable} -test chan-io-41.6 {Tcl_FileeventCmd: directory} -constraints fileevent -setup { +test chan-io-41.6 {Tcl_FileeventCmd: directory} -constraints {fileevent unix} -setup { set tempdir [::tcltests::tempdir] } -body { - set chan [open $tempdir] + set chan [open $tempdir] chan event $chan readable [list ::apply [list {} { variable success set success 1 @@ -5546,12 +5546,12 @@ test chan-io-41.7 {Tcl_FileeventCmd: special} -constraints { } -result 1 -test chan-io-41.8 {Tcl_FileeventCmd: symbolic link} -constraints fileevent -setup { +test chan-io-41.8 {Tcl_FileeventCmd: symbolic link} -constraints {fileevent unix} -setup { set tempdir [::tcltests::tempdir] } -body { set target [makeFile {not again} thefile $tempdir] set link [file join $tempdir thelin] - file link -symbolic $link $target + file link -symbolic $link $target set chan [open $link] chan event $chan readable [list ::apply [list {} { variable success diff --git a/tests/coroutine.test b/tests/coroutine.test index b129c03..c3023f7 100644 --- a/tests/coroutine.test +++ b/tests/coroutine.test @@ -755,6 +755,77 @@ test coroutine-7.12 {coro floor above street level #3008307} -body { rename boom {}; rename cc {}; rename c {} } -result {} + +test coroutine-7.13 { + issue f9800d52bd61f240 + + vwait is not NRE-enabled, and yieldto cannot find the right splicing spot +} -body { + coroutine c0 apply [list {} { + variable done + yield + yieldto c1 + after 0 c2 + vwait [namespace current]::done + } [namespace current]] + + coroutine c1 apply [list {} { + yield + tailcall c0 + } [namespace current]] + + coroutine c2 apply [list {} { + variable done + yield + yieldto try {yieldto c1} on error {} [list after 0 [list [info coroutine]]] + yieldto try {yieldto c1} on error {} [list after 0 [list [info coroutine]]] + set done 1 + } [namespace current]] + + after 0 [list [namespace which c0]] + vwait [namespace current]::done + return $done +} -result 1 + + +test coroutine-7.14 { + issue 5106fddd4400e5b9 + + failure to yieldto is not the same thing as not calling yieldto in the + first place +} -body { + variable done + variable done1 + + coroutine c0 ::apply [list {} { + yield + after 0 [list [namespace which c1]] + vwait [namespace current]::done1 + } [namespace current]] + + coroutine c1 ::apply [list {} { + variable done1 + yield + yieldto try "yieldto [list [info coroutine]]" on error {} " + ::set [list [namespace current]]::done1 failure + ::set [list [namespace current]]::done0 failure + " + set done1 success + + } [namespace current]] + after 1 [list [namespace which c0]] + vwait [namespace current]::done0 + if {[namespace which [namespace current]::c1] ne {}} { + # prior to the fix for 5106fddd4400e5b9, the nested yieldto turned into a + # tailcall which was eventutally activated, causing control to return to + # c1. After the fix, that doesn't happen, so if c1 still exists call it + # one final time to allow it to finish and clean up + rename c1 {} + } + return [list $done0 $done1] +} -result {failure failure} + + test coroutine-8.0.0 {coro inject executed} -body { coroutine demo apply {{} { foreach i {1 2} yield }} demo diff --git a/tests/encoding.test b/tests/encoding.test index 21610a7..cc15cde 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -429,6 +429,21 @@ test encoding-15.21 {UtfToUtfProc CESU-8 noncharacter} { binary scan $y H* z list [string length $y] $z } {3 efbfbf} +test encoding-15.22 {UtfToUtfProc CESU-8 bug [048dd20b4171c8da]} { + set y [encoding convertto cesu-8 \x80] + binary scan $y H* z + list [string length $y] $z +} {2 c280} +test encoding-15.23 {UtfToUtfProc CESU-8 bug [048dd20b4171c8da]} { + set y [encoding convertto cesu-8 \u100] + binary scan $y H* z + list [string length $y] $z +} {2 c480} +test encoding-15.24 {UtfToUtfProc CESU-8 bug [048dd20b4171c8da]} { + set y [encoding convertto cesu-8 \u3FF] + binary scan $y H* z + list [string length $y] $z +} {2 cfbf} test encoding-16.1 {Utf16ToUtfProc} -body { set val [encoding convertfrom utf-16 NN] diff --git a/tools/encoding/iso8859-7.txt b/tools/encoding/iso8859-7.txt index 245595d..9131ae3 100644 --- a/tools/encoding/iso8859-7.txt +++ b/tools/encoding/iso8859-7.txt @@ -16,7 +16,7 @@ # ISO 8859-7:2003 characters map into Unicode. # # ISO 8859-7:1987 is equivalent to ISO-IR-126, ELOT 928, -# and ECMA 118. ISO 8859-7:2003 adds two currency signs +# and ECMA 118. ISO 8859-7:2003 adds two currency signs # and one other character not in the earlier standard. # # Format: Three tab-separated columns diff --git a/unix/Makefile.in b/unix/Makefile.in index 8c96906..99b38a0 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -2388,9 +2388,9 @@ html-tk: ${NATIVE_TCLSH} BUILD_HTML = \ @${NATIVE_TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl \ - --useversion=$(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) \ + --useversion=$(MAJOR_VERSION).$(MINOR_VERSION) \ --htmldir="$(HTML_INSTALL_DIR)" \ - --srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS) + --srcdir=$(TOP_DIR) $(BUILD_HTML_FLAGS) #-------------------------------------------------------------------------- # The list of all the targets that do not correspond to real files. This stops diff --git a/unix/README b/unix/README index 3c1a207..b8adc71 100644 --- a/unix/README +++ b/unix/README @@ -8,11 +8,11 @@ MacOSX platform too, but they all depend on UNIX (POSIX/ANSI C) interfaces and some of them only make sense under UNIX. Updated forms of the information found in this file is available at: - http://www.tcl.tk/doc/howto/compile.html#unix + https://www.tcl-tk.org/doc/howto/compile.html#unix For information on platforms where Tcl is known to compile, along with any porting notes for getting it to work on those platforms, see: - http://www.tcl.tk/software/tcltk/platforms.html + https://www.tcl-tk.org/software/tcltk/platforms.html The rest of this file contains instructions on how to do this. The release should compile and run either "out of the box" or with trivial changes on any @@ -89,7 +89,7 @@ How To Compile And Install Tcl: --enable-dtrace Enable tcl DTrace provider (if DTrace is available on the platform), c.f. tclDTrace.d for descriptions of the probes made available, - see http://wiki.tcl.tk/DTrace for more details + see https://wiki.tcl-lang.org/page/DTrace for more details --with-encoding=ENCODING Specifies the encoding for compile-time configuration values. Defaults to utf-8, which is also sufficient for ASCII. diff --git a/unix/tcl.pc.in b/unix/tcl.pc.in index 2693cd8..21ea0ce 100644 --- a/unix/tcl.pc.in +++ b/unix/tcl.pc.in @@ -8,7 +8,7 @@ libfile=@TCL_LIB_FILE@ Name: Tool Command Language Description: Tcl is a powerful, easy-to-learn dynamic programming language, suitable for a wide range of uses. -URL: http://www.tcl.tk/ +URL: https://www.tcl-tk.org/ Version: @TCL_VERSION@@TCL_PATCH_LEVEL@ Requires.private: zlib >= 1.2.3, libtommath >= 1.2.0 Libs: -L${libdir} @TCL_LIB_FLAG@ @TCL_STUB_LIB_FLAG@ diff --git a/unix/tcl.spec b/unix/tcl.spec index e719a48..3956126 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -9,7 +9,7 @@ Release: 2 License: BSD Group: Development/Languages Source: http://prdownloads.sourceforge.net/tcl/tcl%{version}-src.tar.gz -URL: http://www.tcl.tk/ +URL: https://www.tcl-lang.org/ Buildroot: /var/tmp/%{name}%{version} %description diff --git a/unix/tclKqueueNotfy.c b/unix/tclKqueueNotfy.c index ab3732d..6606c8c 100644 --- a/unix/tclKqueueNotfy.c +++ b/unix/tclKqueueNotfy.c @@ -182,7 +182,10 @@ PlatformEventsControl( if (fstat(filePtr->fd, &fdStat) == -1) { Tcl_Panic("fstat: %s", strerror(errno)); - } else if ((fdStat.st_mode & S_IFMT) == S_IFREG) { + } else if ((fdStat.st_mode & S_IFMT) == S_IFREG + || (fdStat.st_mode & S_IFMT) == S_IFDIR + || (fdStat.st_mode & S_IFMT) == S_IFLNK + ) { switch (op) { case EV_ADD: if (isNew) { @@ -9,7 +9,7 @@ that are specific to Microsoft Windows. The information in this file is maintained on the web at: - http://www.tcl.tk/doc/howto/compile.html#win + https://www.tcl-lang.org/doc/howto/compile.html#win 2. Compiling Tcl ---------------- @@ -29,7 +29,7 @@ In order to compile Tcl for Windows, you need the following: or - Cygwin + MinGW-w64 [http://cygwin.com/install.html] + Cygwin + MinGW-w64 [https://cygwin.com/install.html] (win32 or win64) or @@ -42,11 +42,6 @@ In order to compile Tcl for Windows, you need the following: Msys + MinGW-w64 [http://mingw-w64.sourceforge.net/] (win32 or win64) - or - - Msys + MinGW [http://www.mingw.org/download.shtml] - (win32 only) - In practice, this release is built with Visual C++ 6.0 and the TEA Makefile. diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 972e8b9..71d727f 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -14,8 +14,10 @@ #define _CRT_SECURE_NO_DEPRECATE #include <windows.h> +#ifdef _MSC_VER #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") +#endif #include <stdio.h> #include <math.h> @@ -28,7 +30,7 @@ /* protos */ static int CheckForCompilerFeature(const char *option); -static int CheckForLinkerFeature(const char **options, int count); +static int CheckForLinkerFeature(char **options, int count); static int IsIn(const char *string, const char *substring); static int SubstituteFile(const char *substs, const char *filename); static int QualifyPath(const char *path); @@ -45,8 +47,8 @@ typedef struct { char buffer[STATICBUFFERSIZE]; } pipeinfo; -pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'}; -pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'}; +pipeinfo Out = {INVALID_HANDLE_VALUE, ""}; +pipeinfo Err = {INVALID_HANDLE_VALUE, ""}; /* * exitcodes: 0 == no, 1 == yes, 2 == error @@ -264,7 +266,7 @@ CheckForCompilerFeature( "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| - FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], + FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; @@ -317,7 +319,7 @@ CheckForCompilerFeature( static int CheckForLinkerFeature( - const char **options, + char **options, int count) { STARTUPINFO si; @@ -398,7 +400,7 @@ CheckForLinkerFeature( "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| - FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], + FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; @@ -494,7 +496,6 @@ GetVersionFromFile( const char *match, int numdots) { - size_t cbBuffer = 100; static char szBuffer[100]; char *szResult = NULL; FILE *fp = fopen(filename, "rt"); @@ -504,7 +505,7 @@ GetVersionFromFile( * Read data until we see our match string. */ - while (fgets(szBuffer, cbBuffer, fp) != NULL) { + while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) { LPSTR p, q; p = strstr(szBuffer, match); @@ -514,7 +515,7 @@ GetVersionFromFile( */ p += strlen(match); - while (*p && !isdigit(*p)) { + while (*p && !isdigit((unsigned char)*p)) { ++p; } @@ -523,14 +524,13 @@ GetVersionFromFile( */ q = p; - while (*q && (strchr("0123456789.ab", *q)) && ((!strchr(".ab", *q) - && (!strchr("ab", q[-1])) || --numdots))) { + while (*q && (strchr("0123456789.ab", *q)) && (((!strchr(".ab", *q) + && !strchr("ab", q[-1])) || --numdots))) { ++q; } - memcpy(szBuffer, p, q - p); - szBuffer[q-p] = 0; - szResult = szBuffer; + *q = 0; + szResult = p; break; } } @@ -553,7 +553,7 @@ typedef struct list_item_t { static list_item_t * list_insert(list_item_t **listPtrPtr, const char *key, const char *value) { - list_item_t *itemPtr = malloc(sizeof(list_item_t)); + list_item_t *itemPtr = (list_item_t *)malloc(sizeof(list_item_t)); if (itemPtr) { itemPtr->key = strdup(key); itemPtr->value = strdup(value); @@ -602,9 +602,7 @@ SubstituteFile( const char *substitutions, const char *filename) { - size_t cbBuffer = 1024; static char szBuffer[1024], szCopy[1024]; - char *szResult = NULL; list_item_t *substPtr = NULL; FILE *fp, *sp; @@ -617,7 +615,7 @@ SubstituteFile( sp = fopen(substitutions, "rt"); if (sp != NULL) { - while (fgets(szBuffer, cbBuffer, sp) != NULL) { + while (fgets(szBuffer, sizeof(szBuffer), sp) != NULL) { unsigned char *ks, *ke, *vs, *ve; ks = (unsigned char*)szBuffer; while (ks && *ks && isspace(*ks)) ++ks; @@ -648,7 +646,7 @@ SubstituteFile( * Run the substitutions over each line of the input */ - while (fgets(szBuffer, cbBuffer, fp) != NULL) { + while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { char *m = strstr(szBuffer, p->key); @@ -665,7 +663,7 @@ SubstituteFile( memcpy(szBuffer, szCopy, sizeof(szCopy)); } } - printf(szBuffer); + printf("%s", szBuffer); } list_free(&substPtr); @@ -716,7 +714,8 @@ static int LocateDependencyHelper(const char *dir, const char *keypath) { HANDLE hSearch; char path[MAX_PATH+1]; - int dirlen, keylen, ret; + size_t dirlen; + int keylen, ret; WIN32_FIND_DATA finfo; if (dir == NULL || keypath == NULL) @@ -783,7 +782,8 @@ static int LocateDependencyHelper(const char *dir, const char *keypath) */ static int LocateDependency(const char *keypath) { - int i, ret; + size_t i; + int ret; static const char *paths[] = {"..", "..\\..", "..\\..\\.."}; for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) { diff --git a/win/tclWinFile.c b/win/tclWinFile.c index f54349b..4a07f04 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -3140,7 +3140,7 @@ TclNativeCreateNativeRep( * If there is no "\\?\" prefix but there is a drive or UNC path prefix * and the path is larger than MAX_PATH chars, no Win32 API function can * handle that unless it is prefixed with the extended path prefix. See: - * <http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath> + * <https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maxpath> */ if (((str[0] >= 'A' && str[0] <= 'Z') || (str[0] >= 'a' && str[0] <= 'z')) |