diff options
author | vincentdarley <vincentdarley> | 2003-10-13 16:48:05 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2003-10-13 16:48:05 (GMT) |
commit | 8eb669eea67550509d7223f16753001c943d3ee3 (patch) | |
tree | ccb9c39961e0f152b829dff8a1e6b47fcc6d99a3 /unix/tclUnixFile.c | |
parent | 805e2ca6c7ac542dd65701379332c399bde0dd1d (diff) | |
download | tcl-8eb669eea67550509d7223f16753001c943d3ee3.zip tcl-8eb669eea67550509d7223f16753001c943d3ee3.tar.gz tcl-8eb669eea67550509d7223f16753001c943d3ee3.tar.bz2 |
filesystem bug fixes
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r-- | unix/tclUnixFile.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 3e74d16..d68bebd 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.32 2003/02/12 18:57:52 vincentdarley Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.33 2003/10/13 16:48:07 vincentdarley Exp $ */ #include "tclInt.h" @@ -221,6 +221,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) if (NativeMatchType(native, types)) { Tcl_ListObjAppendElement(interp, resultPtr, pathPtr); } + Tcl_DecrRefCount(fileNamePtr); return TCL_OK; } else { DIR *d; @@ -277,6 +278,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) Tcl_DStringValue(&dsOrig), "\": ", Tcl_PosixError(interp), (char *) NULL); Tcl_DStringFree(&dsOrig); + Tcl_DecrRefCount(fileNamePtr); return TCL_ERROR; } @@ -330,6 +332,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) closedir(d); Tcl_DStringFree(&ds); Tcl_DStringFree(&dsOrig); + Tcl_DecrRefCount(fileNamePtr); return TCL_OK; } } @@ -745,10 +748,14 @@ TclpObjLink(pathPtr, toPtr, linkAction) char link[MAXPATHLEN]; int length; Tcl_DString ds; - - if (Tcl_FSGetTranslatedPath(NULL, pathPtr) == NULL) { + Tcl_Obj *transPtr; + + transPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr); + if (transPtr == NULL) { return NULL; } + Tcl_DecrRefCount(transPtr); + length = readlink(Tcl_FSGetNativePath(pathPtr), link, sizeof(link)); if (length < 0) { return NULL; |