summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-10-04 06:48:59 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-10-04 06:48:59 (GMT)
commitd65d3e5a4e9083feb8074c9dceec7ef13baf769f (patch)
treea153f331249f72176bd71c5b5f2ea1c195de1b7d
parent7c5632f03d6a29b10e0df07f022f5cf3ad826ce1 (diff)
downloadtcl-d65d3e5a4e9083feb8074c9dceec7ef13baf769f.zip
tcl-d65d3e5a4e9083feb8074c9dceec7ef13baf769f.tar.gz
tcl-d65d3e5a4e9083feb8074c9dceec7ef13baf769f.tar.bz2
Fix gcc unused var warning
-rw-r--r--generic/tclZipfs.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index ffa46d6..f04614a 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -5448,8 +5448,6 @@ ZipFSMatchInDirectoryProc(
const char *pattern, /* What names we are looking for. */
Tcl_GlobTypeData *types) /* What types we are looking for. */
{
- Tcl_HashEntry *hPtr;
- Tcl_HashSearch search;
Tcl_Obj *normPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
int scnt, l, dirOnly = -1, mounts = 0;
Tcl_Size prefixLen, len, strip = 0;
@@ -5552,9 +5550,11 @@ ZipFSMatchInDirectoryProc(
scnt = CountSlashes(pat);
Tcl_HashTable duplicates;
- int notDuplicate;
+ int notDuplicate = 0;
Tcl_InitHashTable(&duplicates, TCL_STRING_KEYS);
+ Tcl_HashEntry *hPtr;
+ Tcl_HashSearch search;
if (foundInHash) {
for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search); hPtr;
hPtr = Tcl_NextHashEntry(&search)) {
@@ -5576,12 +5576,10 @@ ZipFSMatchInDirectoryProc(
if (dirOnly) {
/*
* Not found in hash. May be a path that is the ancestor of a mount.
- * e.g. glob //zipfs:/a/* with mount at //zipfs:/a/b/c. Also have
+ * e.g. glob //zipfs:/a/? with mount at //zipfs:/a/b/c. Also have
* to be careful about duplicates, such as when another mount is
* //zipfs:/a/b/d
*/
- Tcl_HashEntry *hPtr;
- Tcl_HashSearch search;
Tcl_DString ds;
Tcl_DStringInit(&ds);
for (hPtr = Tcl_FirstHashEntry(&ZipFS.zipHash, &search); hPtr;
@@ -5596,8 +5594,8 @@ ZipFSMatchInDirectoryProc(
zf->mountPoint + strip,
end ? (Tcl_Size)(end - zf->mountPoint) : -1);
const char *matchedPath = Tcl_DStringValue(&ds);
- Tcl_HashEntry *dupTableEntry =
- Tcl_CreateHashEntry(&duplicates, matchedPath, &notDuplicate);
+ (void)Tcl_CreateHashEntry(
+ &duplicates, matchedPath, &notDuplicate);
if (notDuplicate) {
AppendWithPrefix(
result, prefixBuf, matchedPath, Tcl_DStringLength(&ds));