diff options
Diffstat (limited to 'unix/tclUnixFCmd.c')
-rw-r--r-- | unix/tclUnixFCmd.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index e3d9022..a695e9c 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -967,11 +967,11 @@ TraverseUnixTree( return result; } - Tcl_DStringAppend(sourcePtr, "/", 1); + TclDStringAppendLiteral(sourcePtr, "/"); sourceLen = Tcl_DStringLength(sourcePtr); if (targetPtr != NULL) { - Tcl_DStringAppend(targetPtr, "/", 1); + TclDStringAppendLiteral(targetPtr, "/"); targetLen = Tcl_DStringLength(targetPtr); } @@ -1387,11 +1387,9 @@ GetOwnerAttribute( *attributePtrPtr = Tcl_NewIntObj((int) statBuf.st_uid); } else { Tcl_DString ds; - const char *utf; - utf = Tcl_ExternalToUtfDString(NULL, pwPtr->pw_name, -1, &ds); - *attributePtrPtr = Tcl_NewStringObj(utf, Tcl_DStringLength(&ds)); - Tcl_DStringFree(&ds); + (void) Tcl_ExternalToUtfDString(NULL, pwPtr->pw_name, -1, &ds); + *attributePtrPtr = TclDStringToObj(&ds); } return TCL_OK; } @@ -2127,24 +2125,24 @@ TclpOpenTemporaryFile( Tcl_DStringAppend(&template, DefaultTempDir(), -1); /* INTL: native */ } - Tcl_DStringAppend(&template, "/", -1); + TclDStringAppendLiteral(&template, "/"); if (basenameObj) { string = Tcl_GetStringFromObj(basenameObj, &len); Tcl_UtfToExternalDString(NULL, string, len, &tmp); - Tcl_DStringAppend(&template, Tcl_DStringValue(&tmp), -1); + TclDStringAppendDString(&template, &tmp); Tcl_DStringFree(&tmp); } else { - Tcl_DStringAppend(&template, "tcl", -1); + TclDStringAppendLiteral(&template, "tcl"); } - Tcl_DStringAppend(&template, "_XXXXXX", -1); + TclDStringAppendLiteral(&template, "_XXXXXX"); #ifdef HAVE_MKSTEMPS if (extensionObj) { string = Tcl_GetStringFromObj(extensionObj, &len); Tcl_UtfToExternalDString(NULL, string, len, &tmp); - Tcl_DStringAppend(&template, Tcl_DStringValue(&tmp), -1); + TclDStringAppendDString(&template, &tmp); fd = mkstemps(Tcl_DStringValue(&template), Tcl_DStringLength(&tmp)); Tcl_DStringFree(&tmp); } else |