@@ -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 */
@@ -4339,6 +4340,7 @@ ScriptLibrarySetup(
4339
4340
Tcl_DecrRefCount (searchPathObj );
4340
4341
/* Bug [fccb9f322f]. Reinit system encoding after setting search path */
4341
4342
TclpSetInitialEncodings ();
4343
+ zipfs_tcl_library_init = 1 ;
4342
4344
return libDirObj ;
4343
4345
}
4344
4346
@@ -4356,10 +4358,13 @@ TclZipfs_TclLibrary(void)
4356
4358
4357
4359
/*
4358
4360
* Use the cached value if that has been set; we don't want to repeat the
4359
- * searching and mounting.
4361
+ * searching and mounting. Even if it is not found, see [62019f8aa9f5ec73].
4360
4362
*/
4361
-
4362
- if (zipfs_literal_tcl_library ) {
4363
+
4364
+ if (zipfs_tcl_library_init ) {
4365
+ if (!zipfs_literal_tcl_library ) {
4366
+ return NULL ;
4367
+ }
4363
4368
return ScriptLibrarySetup (zipfs_literal_tcl_library );
4364
4369
}
4365
4370
@@ -4416,6 +4421,11 @@ TclZipfs_TclLibrary(void)
4416
4421
if (zipfs_literal_tcl_library ) {
4417
4422
return ScriptLibrarySetup (zipfs_literal_tcl_library );
4418
4423
}
4424
+ /*
4425
+ * No zipfs tcl-library, mark it to avoid performance penalty [62019f8aa9f5ec73],
4426
+ * by future calls (child interpreters, threads, etc).
4427
+ */
4428
+ zipfs_tcl_library_init = 1 ;
4419
4429
return NULL ;
4420
4430
}
4421
4431
0 commit comments