diff options
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r-- | generic/tclIOUtil.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 325f017..f526d40 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -17,7 +17,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.100 2004/04/07 15:54:15 vincentdarley Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.101 2004/04/23 12:09:37 vincentdarley Exp $ */ #include "tclInt.h" @@ -3357,7 +3357,9 @@ Tcl_FSSplitPath(pathPtr, lenPtr) if (fsPtr->filesystemSeparatorProc != NULL) { Tcl_Obj *sep = (*fsPtr->filesystemSeparatorProc)(pathPtr); if (sep != NULL) { + Tcl_IncrRefCount(sep); separator = Tcl_GetString(sep)[0]; + Tcl_DecrRefCount(sep); } } @@ -4261,7 +4263,8 @@ Tcl_FSFileSystemInfo(pathPtr) * Results: * A Tcl object, with a refCount of zero. If the caller * needs to retain a reference to the object, it should - * call Tcl_IncrRefCount. + * call Tcl_IncrRefCount, and should otherwise free the + * object. * * Side effects: * The path object may be converted to a path type. @@ -4279,9 +4282,13 @@ Tcl_FSPathSeparator(pathPtr) } if (fsPtr->filesystemSeparatorProc != NULL) { return (*fsPtr->filesystemSeparatorProc)(pathPtr); + } else { + /* + * Allow filesystems not to provide a filesystemSeparatorProc + * if they wish to use the standard forward slash. + */ + return Tcl_NewStringObj("/", 1); } - - return NULL; } /* |