diff options
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r-- | generic/tclFileName.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index e7dedf0..f5e7970 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.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: tclFileName.c,v 1.36 2002/05/30 09:27:11 vincentdarley Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.37 2002/06/05 11:59:33 das Exp $ */ #include "tclInt.h" @@ -2083,7 +2083,6 @@ TclGlob(interp, pattern, unquotedPrefix, globFlags, types) Tcl_ResetResult(interp); result = TclDoGlob(interp, separators, &buffer, tail, types); - Tcl_DStringFree(&buffer); if (result != TCL_OK) { if (globFlags & TCL_GLOBMODE_NO_COMPLAIN) { @@ -2116,6 +2115,16 @@ TclGlob(interp, pattern, unquotedPrefix, globFlags, types) Tcl_ListObjGetElements(NULL, Tcl_GetObjResult(interp), &objc, &objv); +#ifdef MAC_TCL + /* adjust prefixLen if TclDoGlob prepended a ':' */ + if ((prefixLen > 0) && (objc > 0) + && (Tcl_DStringValue(&buffer)[0] != ':')) { + char *str = Tcl_GetStringFromObj(objv[0],NULL); + if (str[0] == ':') { + prefixLen++; + } + } +#endif for (i = 0; i< objc; i++) { Tcl_Obj* elt; if (globFlags & TCL_GLOBMODE_TAILS) { @@ -2145,6 +2154,7 @@ TclGlob(interp, pattern, unquotedPrefix, globFlags, types) * end here so we free our reference. */ Tcl_DecrRefCount(oldResult); + Tcl_DStringFree(&buffer); return result; } |