diff options
author | nijtmans <nijtmans@noemail.net> | 2009-12-21 23:25:38 (GMT) |
---|---|---|
committer | nijtmans <nijtmans@noemail.net> | 2009-12-21 23:25:38 (GMT) |
commit | 066016b2e1d0a5ac7832bd0be1b00e33e0b81b1d (patch) | |
tree | 86d9a8cc06d969564b99b6d5ed25975042f9300a /generic/tclPathObj.c | |
parent | cde6ace493c3bf9042b9f20bea8c034591870a4b (diff) | |
download | tcl-066016b2e1d0a5ac7832bd0be1b00e33e0b81b1d.zip tcl-066016b2e1d0a5ac7832bd0be1b00e33e0b81b1d.tar.gz tcl-066016b2e1d0a5ac7832bd0be1b00e33e0b81b1d.tar.bz2 |
Various CYGWIN-related fixes. In the win32 configure script, CYGWIN is still not enabled yet, but at least it is a step in the right direction.
FossilOrigin-Name: dca4a9980ea1e6abbb78a199f0fbf597beb38138
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r-- | generic/tclPathObj.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 6d36fe4..610c05e 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclPathObj.c,v 1.84 2009/10/27 20:31:08 dgp Exp $ + * RCS: @(#) $Id: tclPathObj.c,v 1.85 2009/12/21 23:25:39 nijtmans Exp $ */ #include "tclInt.h" @@ -2369,7 +2369,10 @@ SetFsPathFromAny( FsPath *fsPathPtr; Tcl_Obj *transPtr; char *name; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&tclFsDataKey); +#if defined(__CYGWIN__) && defined(__WIN32__) + int copied = 0; +#endif + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&tclFsDataKey); if (pathPtr->typePtr == &tclFsPathType) { return TCL_OK; @@ -2514,7 +2517,6 @@ SetFsPathFromAny( #if defined(__CYGWIN__) && defined(__WIN32__) { - extern int cygwin_conv_to_win32_path(const char *, char *); char winbuf[MAX_PATH+1]; /* @@ -2527,6 +2529,11 @@ SetFsPathFromAny( if (len > 0) { cygwin_conv_to_win32_path(name, winbuf); TclWinNoBackslash(winbuf); + if (Tcl_IsShared(transPtr)) { + copied = 1; + transPtr = Tcl_DuplicateObj(transPtr); + Tcl_IncrRefCount(transPtr); + } Tcl_SetStringObj(transPtr, winbuf, -1); } } @@ -2557,6 +2564,11 @@ SetFsPathFromAny( SETPATHOBJ(pathPtr, fsPathPtr); PATHFLAGS(pathPtr) = 0; pathPtr->typePtr = &tclFsPathType; +#if defined(__CYGWIN__) && defined(__WIN32__) + if (copied) { + Tcl_DecrRefCount(transPtr); + } +#endif return TCL_OK; } |