Tcl Source Code

Artifact [b6426fbe3c]
Login

Artifact b6426fbe3c272c8e4a4ef0f1566835ed54a7d6b727aafbfb6a8827bc4db6e88a:

Attachment "diff" to ticket [7da6c2d04c] added by ralfixx 2026-05-26 17:57:28.
diff -u tcl9.0.3/generic/tclIO.c\~ tcl9.0.3/generic/tclIO.c
--- tcl9.0.3/generic/tclIO.c~	2026-05-22 17:56:17.997897142 +0200
+++ tcl9.0.3/generic/tclIO.c	2026-05-26 19:14:13.100617456 +0200
@@ -9239,6 +9239,7 @@
     const char *chanName;
     int modeIndex;		/* Index of mode argument. */
     int mask;
+    Tcl_Size length;            /* llength of callback script */
     static const char *const modeOptions[] = {"readable", "writable", NULL};
     static const int maskArray[] = {TCL_READABLE, TCL_WRITABLE};
 
@@ -9285,8 +9286,10 @@
     /*
      * If we are supposed to delete a stored script, do so.
      */
-
-    if (*(TclGetString(objv[3])) == '\0') {
+    if (Tcl_ListObjLength(NULL, objv[3], &length) != TCL_OK) {
+        TclGetStringFromObj(objv[3], &length);
+    }
+    if (0 == length) {
 	DeleteScriptRecord(interp, chanPtr, mask);
 	return TCL_OK;
     }

Diff finished.  Tue May 26 19:55:56 2026