summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2025-06-17 16:27:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2025-06-17 16:27:34 (GMT)
commitb55915dc2ddcbcb0533dc1207c48162d760b3909 (patch)
tree2e1f0e551162a66852d3b6d0e5c5f8fb91ef2a31
parent94b7fc5ca76cb063dd3ba44eb46aae8888d939b6 (diff)
parentec6493f2b8337529026bd3dbecfd8e19b9550d76 (diff)
downloadtcl-b55915dc2ddcbcb0533dc1207c48162d760b3909.zip
tcl-b55915dc2ddcbcb0533dc1207c48162d760b3909.tar.gz
tcl-b55915dc2ddcbcb0533dc1207c48162d760b3909.tar.bz2
merge 9.0
-rw-r--r--README.md2
-rw-r--r--generic/tclIOCmd.c29
-rw-r--r--macosx/README32
3 files changed, 37 insertions, 26 deletions
diff --git a/README.md b/README.md
index c6ffd6f..44016e8 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ site](https://sourceforge.net/projects/tcl/files/Tcl/).
Tcl provides a powerful platform for creating integration applications that
tie together diverse applications, protocols, devices, and frameworks.
When paired with the Tk toolkit, Tcl provides the fastest and most powerful
-way to create GUI applications that run on PCs, Unix, and Mac OS X.
+way to create GUI applications that run on PCs, Unix, and macOS.
Tcl can also be used for a variety of web-related tasks and for creating
powerful command languages for applications.
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 485812f..bd3a462 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -948,8 +948,16 @@ Tcl_ExecObjCmd(
Tcl_SetResult(interp, "No value given for option -encoding.",
TCL_STATIC);
return TCL_ERROR;
+ } else {
+ Tcl_Encoding encoding;
+ encodingObj = objv[skip];
+ /* Verify validity - bug [da5e1bc7bc] */
+ if (Tcl_GetEncodingFromObj(interp, encodingObj, &encoding)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ Tcl_FreeEncoding(encoding);
}
- encodingObj = objv[skip];
break;
}
}
@@ -1014,16 +1022,14 @@ Tcl_ExecObjCmd(
/* Bug [0f1ddc0df7] - encoding errors - use replace profile */
if (Tcl_SetChannelOption(interp, chan, "-profile", "replace") != TCL_OK) {
- return TCL_ERROR;
+ goto errorWithOpenChannel;
}
/* TIP 716 */
- if (encodingObj) {
- if (Tcl_SetChannelOption(
- interp, chan, "-encoding", Tcl_GetString(encodingObj)) !=
- TCL_OK) {
- return TCL_ERROR;
- }
+ if (encodingObj &&
+ Tcl_SetChannelOption(interp, chan, "-encoding",
+ Tcl_GetString(encodingObj)) != TCL_OK) {
+ goto errorWithOpenChannel;
}
TclNewObj(resultPtr);
@@ -1042,7 +1048,7 @@ Tcl_ExecObjCmd(
Tcl_PosixError(interp)));
Tcl_DecrRefCount(resultPtr);
}
- return TCL_ERROR;
+ goto errorWithOpenChannel;
}
}
@@ -1069,6 +1075,11 @@ Tcl_ExecObjCmd(
Tcl_SetObjResult(interp, resultPtr);
return result;
+
+errorWithOpenChannel:
+ /* Interpreter should already contain error. Pass NULL to not overwrite */
+ (void)Tcl_CloseEx(NULL, chan, 0);
+ return TCL_ERROR;
}
/*
diff --git a/macosx/README b/macosx/README
index f5e3716..c4221e4 100644
--- a/macosx/README
+++ b/macosx/README
@@ -1,7 +1,7 @@
-Tcl Mac OS X README
+Tcl macOS README
-------------------
-This is the README file for the Mac OS X/Darwin version of Tcl.
+This is the README file for the macOS/Darwin version of Tcl.
1. Where to go for support
@@ -63,14 +63,15 @@ framework directories:
3. Building Tcl on Mac OS X
---------------------------
-- At least Mac OS X 10.3 is required to build Tcl.
-Apple's Xcode Developer Tools need to be installed (only the most recent version
-matching your OS release is supported), the Xcode installer is available on Mac
-OS X install media or may be present in /Applications/Installers on Macs that
-came with OS X preinstalled. The most recent version can always be downloaded
-from the ADC website http://connect.apple.com (free ADC membership required).
+- Tcl supports macOS 10.13 and newer.
+While Tcl may build on earlier versions of the OS, it is not tested on versions
+older than 10.13. You will need to install an Apple clang toolchain either by
+downloading the Xcode app from Apple's App Store, or by installing the Command
+Line Tools. The Command Line Tools can be installed by running the command:
+ xcode-select --install
+in the Terminal.
-- Tcl is most easily built as a Mac OS X framework via GNUmakefile in tcl/macosx
+- Tcl is most easily built as a macOS framework via the GNUmakefile in tcl/macosx
(see below for details), but can also be built with the standard unix configure
and make buildsystem in tcl/unix as on any other unix platform (indeed, the
GNUmakefile is just a wrapper around the unix buildsystem).
@@ -78,11 +79,10 @@ The Mac OS X specific configure flags are --enable-framework and
--disable-corefoundation (which disables CF and notably reverts to the standard
select based notifier).
-- To build universal binaries outside of the Xcode IDE, set CFLAGS as follows:
- export CFLAGS="-arch x86_64 -arch arm64"
-This requires Mac OS X 10.6 and Xcode 10.2 and will work on any architecture.
-Note that configure requires CFLAGS to contain a least one architecture that can
-be run on the build machine (i.e. x86_64 on Core2/Xeon).
+- To build universal binaries for macOS 10.13 and newer set CFLAGS as follows:
+ export CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.13"
+(This will cause clang to set macOS 11 as the target OS for the arm64 architecture
+since Apple Silicon was not supported until macOS 11.)
Universal builds of Tcl TEA extensions are also possible with CFLAGS set as
above, they will be [load]able by universal as well as thin binaries of Tcl.
@@ -96,8 +96,8 @@ Detailed Instructions for building with macosx/GNUmakefile
Setup this shell variable as follows:
ver="9.0"
-- Setup environment variables as desired, e.g. for a universal build on 10.9:
- CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.9"
+- Setup environment variables as desired, for example:
+ CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.13"
export CFLAGS
- Change to the directory containing the Tcl source tree and build: