diff options
| author | sebres <sebres@users.sourceforge.net> | 2025-08-25 16:42:09 (GMT) |
|---|---|---|
| committer | sebres <sebres@users.sourceforge.net> | 2025-08-25 16:42:09 (GMT) |
| commit | 5860f82135ef9563e1dd60b1c00daeedb1767c7d (patch) | |
| tree | 8574588bc89a33d126f7dee80aab454359a233a2 /generic/tclEncoding.c | |
| parent | a4b27124be697f98b62986258b44d1f0fdf3e697 (diff) | |
| download | tcl-5860f82135ef9563e1dd60b1c00daeedb1767c7d.zip tcl-5860f82135ef9563e1dd60b1c00daeedb1767c7d.tar.gz tcl-5860f82135ef9563e1dd60b1c00daeedb1767c7d.tar.bz2 | |
amend to [0433b67adc] (ticket [87b69745be]): don't return with OK (swallow the error) if encoding cannot be loaded, and current system encoding is NULL for whatever reason
Diffstat (limited to 'generic/tclEncoding.c')
| -rw-r--r-- | generic/tclEncoding.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 43566ce..cbd2dc0 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -996,15 +996,15 @@ Tcl_SetSystemEncoding( ((Encoding *)encoding)->refCount += 1; } else { encoding = Tcl_GetEncoding(interp, name); + if (encoding == NULL) { + Tcl_MutexUnlock(&encodingMutex); + return TCL_ERROR; + } if (encoding == systemEncoding) { FreeEncoding(encoding); Tcl_MutexUnlock(&encodingMutex); return TCL_OK; } - if (encoding == NULL) { - Tcl_MutexUnlock(&encodingMutex); - return TCL_ERROR; - } } assert(encoding != systemEncoding); |
