summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-10-29 14:25:03 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-10-29 14:25:03 (GMT)
commitd165eb244ad4b9050dee074a00ecdda41df575ed (patch)
tree160b0d97655fae4fa54777077ccc0d33d88e000b /unix/tclUnixFile.c
parentc7b81182cc496c61309904a116c693a3dedc6382 (diff)
downloadtcl-d165eb244ad4b9050dee074a00ecdda41df575ed.zip
tcl-d165eb244ad4b9050dee074a00ecdda41df575ed.tar.gz
tcl-d165eb244ad4b9050dee074a00ecdda41df575ed.tar.bz2
Fix for bug 475941; access() was being called with path-free file names on
some paths through the glob code!
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r--unix/tclUnixFile.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index befa699..d78dca4 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFile.c,v 1.12 2001/08/30 08:53:15 vincentdarley Exp $
+ * RCS: @(#) $Id: tclUnixFile.c,v 1.13 2001/10/29 14:25:03 dkf Exp $
*/
#include "tclInt.h"
@@ -301,7 +301,6 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
if (entryPtr == NULL) {
break;
}
-
if (types != NULL && (types->perm & TCL_GLOB_PERM_HIDDEN)) {
/*
* We explicitly asked for hidden files, so turn around
@@ -365,11 +364,11 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
((types->perm & TCL_GLOB_PERM_RONLY) &&
(buf.st_mode & (S_IWOTH|S_IWGRP|S_IWUSR))) ||
((types->perm & TCL_GLOB_PERM_R) &&
- (access(entryPtr->d_name, R_OK) != 0)) ||
+ (access(nativeEntry, R_OK) != 0)) ||
((types->perm & TCL_GLOB_PERM_W) &&
- (access(entryPtr->d_name, W_OK) != 0)) ||
+ (access(nativeEntry, W_OK) != 0)) ||
((types->perm & TCL_GLOB_PERM_X) &&
- (access(entryPtr->d_name, X_OK) != 0))
+ (access(nativeEntry, X_OK) != 0))
)) {
typeOk = 0;
}