@@ -398,6 +398,7 @@ static const char pwrot[17] =
398
398
"\x00\x80\x40\xC0\x20\xA0\x60\xE0"
399
399
"\x10\x90\x50\xD0\x30\xB0\x70\xF0" ;
400
400
401
+ static int zipfs_tcl_library_init = 0 ;
401
402
static const char * zipfs_literal_tcl_library = NULL ;
402
403
403
404
/* Function prototypes */
@@ -4340,6 +4341,7 @@ ScriptLibrarySetup(
4340
4341
Tcl_DecrRefCount (searchPathObj );
4341
4342
/* Bug [fccb9f322f]. Reinit system encoding after setting search path */
4342
4343
TclpSetInitialEncodings ();
4344
+ zipfs_tcl_library_init = 1 ;
4343
4345
return libDirObj ;
4344
4346
}
4345
4347
@@ -4357,10 +4359,13 @@ TclZipfs_TclLibrary(void)
4357
4359
4358
4360
/*
4359
4361
* Use the cached value if that has been set; we don't want to repeat the
4360
- * searching and mounting.
4362
+ * searching and mounting. Even if it is not found, see [62019f8aa9f5ec73].
4361
4363
*/
4362
-
4363
- if (zipfs_literal_tcl_library ) {
4364
+
4365
+ if (zipfs_tcl_library_init ) {
4366
+ if (!zipfs_literal_tcl_library ) {
4367
+ return NULL ;
4368
+ }
4364
4369
return ScriptLibrarySetup (zipfs_literal_tcl_library );
4365
4370
}
4366
4371
@@ -4417,6 +4422,11 @@ TclZipfs_TclLibrary(void)
4417
4422
if (zipfs_literal_tcl_library ) {
4418
4423
return ScriptLibrarySetup (zipfs_literal_tcl_library );
4419
4424
}
4425
+ /*
4426
+ * No zipfs tcl-library, mark it to avoid performance penalty [62019f8aa9f5ec73],
4427
+ * by future calls (child interpreters, threads, etc).
4428
+ */
4429
+ zipfs_tcl_library_init = 1 ;
4420
4430
return NULL ;
4421
4431
}
4422
4432
0 commit comments