diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-09-30 02:58:33 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-09-30 02:58:33 (GMT) |
commit | d7cff9067558c62d7c8259e7fe885c5fa8d5f438 (patch) | |
tree | 894c6f2122258ae6797e267e323a62d1fc7219b4 | |
parent | 99e1b20c806fb795368afb3512e472bd93931313 (diff) | |
download | tcl-d7cff9067558c62d7c8259e7fe885c5fa8d5f438.zip tcl-d7cff9067558c62d7c8259e7fe885c5fa8d5f438.tar.gz tcl-d7cff9067558c62d7c8259e7fe885c5fa8d5f438.tar.bz2 |
Remove obsolete code
-rw-r--r-- | generic/tclZipfs.c | 61 |
1 files changed, 9 insertions, 52 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 14da083..0cc46a0 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -16,7 +16,7 @@ * projects. * * Helpful docs: - * https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.9.TXT + * https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.9.TXT * https://libzip.org/specifications/appnote_iz.txt */ @@ -320,11 +320,10 @@ static int InitWritableChannel(Tcl_Interp *interp, static int ListMountPoints(Tcl_Interp *interp); static int ContainsMountPoint(const char *path, int pathLen); static void CleanupMount(ZipFile *zf); -static void SerializeCentralDirectoryEntry(const unsigned char *start, - const unsigned char *end, - unsigned char *buf, - ZipEntry *z, - size_t nameLength); +static void SerializeCentralDirectoryEntry( + const unsigned char *start, + const unsigned char *end, unsigned char *buf, + ZipEntry *z, size_t nameLength); static void SerializeCentralDirectorySuffix( const unsigned char *start, const unsigned char *end, unsigned char *buf, @@ -2237,6 +2236,7 @@ CleanupMount(ZipFile *zf) /* Mount point */ } ckfree(z); } + zf->entries = NULL; } /* @@ -6225,27 +6225,6 @@ ZipfsAppHookFindTclInit( return TCL_ERROR; } #endif -#ifdef OBSOLETE - -static void -ZipfsExitHandler( - TCL_UNUSED(void *) -) -{ - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - if (ZipFS.initialized != -1) { - hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search); - if (hPtr == NULL) { - ZipfsFinalize(); - } else { - /* ZipFS.fallbackEntryEncoding was already freed by - * ZipfsMountExitHandler - */ - } - } -} -#endif void TclZipfsFinalize(void) { @@ -6275,40 +6254,18 @@ void TclZipfsFinalize(void) if (hPtr == NULL) { hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &zipSearch); if (hPtr == NULL) { - /* Both hash tables empty. Free them */ + /* Both hash tables empty. Free all resources */ + Tcl_FSUnregister(&zipfsFilesystem); Tcl_DeleteHashTable(&ZipFS.fileHash); Tcl_DeleteHashTable(&ZipFS.zipHash); - Tcl_FSUnregister(&zipfsFilesystem); ckfree(ZipFS.fallbackEntryEncoding); - ZipFS.initialized = -1; + ZipFS.initialized = 0; } } Unlock(); } -#ifdef OBSOLETE -static void -ZipfsMountExitHandler( - void *clientData) -{ - Tcl_HashEntry *hPtr; - Tcl_HashSearch search; - - ZipFile *zf = (ZipFile *) clientData; - - if (TCL_OK != TclZipfs_Unmount(NULL, zf->mountPoint)) { - Tcl_Panic("tried to unmount busy filesystem"); - } - - hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search); - if (hPtr == NULL) { - ZipfsFinalize(); - } - -} -#endif - /* *------------------------------------------------------------------------- * |