diff options
author | das <das> | 2002-06-05 11:59:18 (GMT) |
---|---|---|
committer | das <das> | 2002-06-05 11:59:18 (GMT) |
commit | 24229b74b75e8ef219e5f08228243037b6ee7131 (patch) | |
tree | e1fd79f317196368a93f0b09f69169f56c39fc49 /generic | |
parent | 6d6b5b0d0e9c53fadc2e50abbd967d516a317486 (diff) | |
download | tcl-24229b74b75e8ef219e5f08228243037b6ee7131.zip tcl-24229b74b75e8ef219e5f08228243037b6ee7131.tar.gz tcl-24229b74b75e8ef219e5f08228243037b6ee7131.tar.bz2 |
* generic/tclFileName.c (TclGlob): mac specific fix to
recent changes in 'glob -tails' handling.
* mac/tclMacPort.h:
* mac/tclMacChan.c: fixed TIP#91 bustage.
* mac/tclMacResource.c (Tcl_MacConvertTextResource): added utf
conversion of text resource contents.
* tests/macFCmd.test (macFCmd-1.2): allow CWIE creator.
Diffstat (limited to 'generic')
-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; } |