summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 187003d..6d8b751 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -644,12 +644,13 @@ SplitUnixPath(
{
int length;
const char *origPath = path, *elementStart;
- Tcl_Obj *result = Tcl_NewObj();
+ Tcl_Obj *result;
/*
* Deal with the root directory as a special case.
*/
+ TclNewObj(result);
if (*path == '/') {
Tcl_Obj *rootElt;
++path;
@@ -735,9 +736,10 @@ SplitWinPath(
const char *p, *elementStart;
Tcl_PathType type = TCL_PATH_ABSOLUTE;
Tcl_DString buf;
- Tcl_Obj *result = Tcl_NewObj();
+ Tcl_Obj *result;
Tcl_DStringInit(&buf);
+ TclNewObj(result);
p = ExtractWinRoot(path, &buf, 0, &type);
/*
@@ -977,7 +979,7 @@ Tcl_JoinPath(
Tcl_DString *resultPtr) /* Pointer to previously initialized DString */
{
int i, len;
- Tcl_Obj *listObj = Tcl_NewObj();
+ Tcl_Obj *listObj;
Tcl_Obj *resultObj;
const char *resultStr;
@@ -985,6 +987,7 @@ Tcl_JoinPath(
* Build the list of paths.
*/
+ TclNewObj(listObj);
for (i = 0; i < argc; i++) {
Tcl_ListObjAppendElement(NULL, listObj,
Tcl_NewStringObj(argv[i], -1));