summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 7b6a972..0935615 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -228,6 +228,7 @@ TclFSNormalizeAbsolutePath(
if (retVal == NULL) {
const char *path = TclGetString(pathPtr);
+
retVal = Tcl_NewStringObj(path, dirSep - path);
Tcl_IncrRefCount(retVal);
}
@@ -705,7 +706,7 @@ TclPathPart(
return pathPtr;
} else {
Tcl_Obj *root = Tcl_NewStringObj(fileName,
- (int) (length - strlen(extension)));
+ length - strlen(extension));
Tcl_IncrRefCount(root);
return root;
@@ -782,7 +783,7 @@ GetExtension(
if (extension == NULL) {
ret = Tcl_NewObj();
} else {
- ret = Tcl_NewStringObj(extension, -1);
+ ret = Tcl_NewStringObj(extension, TCL_STRLEN);
}
Tcl_IncrRefCount(ret);
return ret;
@@ -1493,7 +1494,8 @@ MakePathFromNormalized(
if (pathPtr->typePtr->updateStringProc == NULL) {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "can't find object string representation", -1));
+ "can't find object string representation",
+ TCL_STRLEN));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "PATH", "WTF",
NULL);
}
@@ -2376,7 +2378,7 @@ SetFsPathFromAny(
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"couldn't find HOME environment variable to"
- " expand path", -1));
+ " expand path", TCL_STRLEN));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "PATH",
"HOMELESS", NULL);
}
@@ -2446,7 +2448,7 @@ SetFsPathFromAny(
*/
Tcl_Obj *joined;
- Tcl_Obj *rest = Tcl_NewStringObj(name+split+1, -1);
+ Tcl_Obj *rest = Tcl_NewStringObj(name+split+1, TCL_STRLEN);
Tcl_IncrRefCount(transPtr);
joined = Tcl_FSJoinToPath(transPtr, 1, &rest);