diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-04 14:05:20 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-04 14:05:20 (GMT) |
commit | 1297b4be9b37d8c39cb9bd2f8451c1b69bc6fa13 (patch) | |
tree | 690246b6abf3458ded10e0293e2c086f894d77ef /unix/tclUnixFile.c | |
parent | 328461c6cf73105f97aee07048a22741b4d2cc2b (diff) | |
parent | 6c67fa6248b76a800bbd47bdc27bfec84e1f0de4 (diff) | |
download | tcl-1297b4be9b37d8c39cb9bd2f8451c1b69bc6fa13.zip tcl-1297b4be9b37d8c39cb9bd2f8451c1b69bc6fa13.tar.gz tcl-1297b4be9b37d8c39cb9bd2f8451c1b69bc6fa13.tar.bz2 |
Merge trunk. First steps in eliminating "source -nopkg". Some test-cases still fail.
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r-- | unix/tclUnixFile.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 886b5ad..5f5bfe0 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -262,14 +262,15 @@ TclpMatchInDirectory( DIR *d; Tcl_DirEntry *entryPtr; const char *dirName; - int dirLength, nativeDirLen; + size_t dirLength, nativeDirLen; int matchHidden, matchHiddenPat; Tcl_StatBuf statBuf; Tcl_DString ds; /* native encoding of dir */ Tcl_DString dsOrig; /* utf-8 encoding of dir */ Tcl_DStringInit(&dsOrig); - dirName = TclGetStringFromObj(fileNamePtr, &dirLength); + dirName = TclGetString(fileNamePtr); + dirLength = fileNamePtr->length; Tcl_DStringAppend(&dsOrig, dirName, dirLength); /* @@ -937,7 +938,6 @@ TclpObjLink( */ if (linkAction & TCL_CREATE_SYMBOLIC_LINK) { - int targetLen; Tcl_DString ds; Tcl_Obj *transPtr; @@ -951,8 +951,8 @@ TclpObjLink( if (transPtr == NULL) { return NULL; } - target = TclGetStringFromObj(transPtr, &targetLen); - target = Tcl_UtfToExternalDString(NULL, target, targetLen, &ds); + target = TclGetString(transPtr); + target = Tcl_UtfToExternalDString(NULL, target, transPtr->length, &ds); Tcl_DecrRefCount(transPtr); if (symlink(target, src) != 0) { @@ -1080,7 +1080,7 @@ TclNativeCreateNativeRep( const char *str; Tcl_DString ds; Tcl_Obj *validPathPtr; - int len; + size_t len; if (TclFSCwdIsNative()) { /* @@ -1105,7 +1105,8 @@ TclNativeCreateNativeRep( Tcl_IncrRefCount(validPathPtr); } - str = TclGetStringFromObj(validPathPtr, &len); + str = TclGetString(validPathPtr); + len = validPathPtr->length; Tcl_UtfToExternalDString(NULL, str, len, &ds); len = Tcl_DStringLength(&ds) + sizeof(char); if (strlen(Tcl_DStringValue(&ds)) < len - sizeof(char)) { |