diff options
author | nijtmans <nijtmans> | 2009-12-21 23:25:39 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2009-12-21 23:25:39 (GMT) |
commit | f7e02c57c848c495a77975b927a0f4076bf4822c (patch) | |
tree | 86d9a8cc06d969564b99b6d5ed25975042f9300a /generic/tclPathObj.c | |
parent | e3f5e21f00d98dacf701c346899ada0ef3327513 (diff) | |
download | tcl-f7e02c57c848c495a77975b927a0f4076bf4822c.zip tcl-f7e02c57c848c495a77975b927a0f4076bf4822c.tar.gz tcl-f7e02c57c848c495a77975b927a0f4076bf4822c.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.
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; } |