diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-02-01 20:36:01 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-02-01 20:36:01 (GMT) |
| commit | eee14742522aed25744851879c80a96134de7369 (patch) | |
| tree | 5650ddb981ce76c5b4348123db6def9c4be1aa68 /win/tclWinFile.c | |
| parent | a6ecb97fa5846d7930c9649f008c490d06e8b054 (diff) | |
| parent | 3106f9a6955f9df9de5df5879319b6e4393ab702 (diff) | |
| download | tcl-eee14742522aed25744851879c80a96134de7369.zip tcl-eee14742522aed25744851879c80a96134de7369.tar.gz tcl-eee14742522aed25744851879c80a96134de7369.tar.bz2 | |
Another (big) round of int -> size_t enhancements. So Tcl can handle string >2GiB in more places.
Diffstat (limited to 'win/tclWinFile.c')
| -rw-r--r-- | win/tclWinFile.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 9545381..7ff8b9b 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -973,8 +973,7 @@ TclpMatchInDirectory( */ Tcl_DStringInit(&dsOrig); - dirName = TclGetString(fileNamePtr); - dirLength = fileNamePtr->length; + dirName = TclGetStringFromObj(fileNamePtr, &dirLength); Tcl_DStringAppend(&dsOrig, dirName, dirLength); lastChar = dirName[dirLength -1]; @@ -2398,7 +2397,7 @@ TclpFilesystemPathType( if (normPath == NULL) { return NULL; } - path = Tcl_GetString(normPath); + path = TclGetString(normPath); if (path == NULL) { return NULL; } @@ -2476,7 +2475,7 @@ TclpObjNormalizePath( Tcl_DString ds; /* Some workspace. */ Tcl_DStringInit(&dsNorm); - path = Tcl_GetString(pathPtr); + path = TclGetString(pathPtr); currentPathEndPosition = path + nextCheckpoint; if (*currentPathEndPosition == '/') { @@ -2570,12 +2569,12 @@ TclpObjNormalizePath( * Convert link to forward slashes. */ - for (path = Tcl_GetString(to); *path != 0; path++) { + for (path = TclGetString(to); *path != 0; path++) { if (*path == '\\') { *path = '/'; } } - path = Tcl_GetString(to); + path = TclGetString(to); currentPathEndPosition = path + nextCheckpoint; if (temp != NULL) { Tcl_DecrRefCount(temp); @@ -2807,7 +2806,7 @@ TclWinVolumeRelativeNormalize( * current volume. */ - const char *drive = Tcl_GetString(useThisCwd); + const char *drive = TclGetString(useThisCwd); absolutePath = Tcl_NewStringObj(drive,2); Tcl_AppendToObj(absolutePath, path, -1); @@ -2822,8 +2821,8 @@ TclWinVolumeRelativeNormalize( * also on drive C. */ - const char *drive = TclGetString(useThisCwd); - size_t cwdLen = useThisCwd->length; + size_t cwdLen; + const char *drive = TclGetStringFromObj(useThisCwd, &cwdLen); char drive_cur = path[0]; if (drive_cur >= 'a') { @@ -2986,10 +2985,9 @@ TclNativeCreateNativeRep( Tcl_IncrRefCount(validPathPtr); } - str = Tcl_GetString(validPathPtr); - len = validPathPtr->length; + str = TclGetStringFromObj(validPathPtr, &len); - if (strlen(str)!=(unsigned int)len) { + if (strlen(str) != len) { /* String contains NUL-bytes. This is invalid. */ goto done; } |
