From e39ec8cfc69936810da41fc0b2bff5ebe0609294 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 7 Sep 2023 14:53:19 +0000 Subject: More patches from juliannoble2. Thanks! --- doc/zipfs.n | 2 +- generic/tclZipfs.c | 11 +---------- library/auto.tcl | 2 +- tests/zipfs.test | 2 +- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/doc/zipfs.n b/doc/zipfs.n index 1e6ddad..b39e82a 100644 --- a/doc/zipfs.n +++ b/doc/zipfs.n @@ -192,7 +192,7 @@ set base [file join [\fBzipfs root\fR] myApp] source [file join $base app.tcl] # use the contents, load libraries from it, etc... -\fBzipfs unmount\fR $zip +\fBzipfs unmount\fR $base .CE .PP Creating a ZIP archive, given that a directory exists containing the content diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 5053c0f..6eaca58 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -2370,7 +2370,7 @@ ZipFSUnmountObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "zipfile"); + Tcl_WrongNumArgs(interp, 1, objv, "mountpoint"); return TCL_ERROR; } return TclZipfs_Unmount(interp, Tcl_GetString(objv[1])); @@ -3669,22 +3669,13 @@ ZipFSExistsObjCmd( { char *filename; int exists; - Tcl_DString ds; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "filename"); return TCL_ERROR; } - /* - * Prepend ZIPFS_VOLUME to filename, eliding the final / - */ - filename = Tcl_GetString(objv[1]); - Tcl_DStringInit(&ds); - Tcl_DStringAppend(&ds, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN - 1); - Tcl_DStringAppend(&ds, filename, -1); - filename = Tcl_DStringValue(&ds); ReadLock(); exists = ZipFSLookup(filename) != NULL; diff --git a/library/auto.tcl b/library/auto.tcl index a4f8d41..2e70873 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -128,7 +128,7 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} { set found 1 break } else { - catch {zipfs unmount $archive} + catch {zipfs unmount $mountpoint} } } } diff --git a/tests/zipfs.test b/tests/zipfs.test index 99e1cdc..b5ecffa 100644 --- a/tests/zipfs.test +++ b/tests/zipfs.test @@ -96,7 +96,7 @@ test zipfs-1.3 {zipfs errors} -constraints zipfs -returnCodes error -body { } -result {wrong # args: should be "zipfs mount ?zipfile? ?mountpoint? ?password?"} test zipfs-1.4 {zipfs errors} -constraints zipfs -returnCodes error -body { zipfs unmount a b c d e f -} -result {wrong # args: should be "zipfs unmount zipfile"} +} -result {wrong # args: should be "zipfs unmount mountpoint"} test zipfs-1.5 {zipfs errors} -constraints zipfs -returnCodes error -body { zipfs mkkey a b c d e f } -result {wrong # args: should be "zipfs mkkey password"} -- cgit v0.12