diff options
Diffstat (limited to 'win/tclWinFCmd.c')
-rw-r--r-- | win/tclWinFCmd.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index d281c22..1465549 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -1524,8 +1524,8 @@ GetWinFileAttributes( * We test for, and fix that case, here. */ - const char *str = TclGetString(fileName); - size_t len = fileName->length; + size_t len; + const char *str = TclGetStringFromObj(fileName, &len); if (len < 4) { if (len == 0) { @@ -1586,6 +1586,7 @@ ConvertFileNameFormat( { int pathc, i; Tcl_Obj *splitPath; + size_t length; splitPath = Tcl_FSSplitPath(fileName, &pathc); @@ -1613,8 +1614,8 @@ ConvertFileNameFormat( Tcl_ListObjIndex(NULL, splitPath, i, &elt); - pathv = TclGetString(elt); - if ((pathv[0] == '/') || ((elt->length == 3) && (pathv[1] == ':')) + pathv = TclGetStringFromObj(elt, &length); + if ((pathv[0] == '/') || ((length == 3) && (pathv[1] == ':')) || (strcmp(pathv, ".") == 0) || (strcmp(pathv, "..") == 0)) { /* * Handle "/", "//machine/export", "c:/", "." or ".." by just @@ -1649,8 +1650,8 @@ ConvertFileNameFormat( * likely to lead to infinite loops. */ - tempString = TclGetString(tempPath); - nativeName = Tcl_WinUtfToTChar(tempString, tempPath->length, &ds); + tempString = TclGetStringFromObj(tempPath, &length); + nativeName = Tcl_WinUtfToTChar(tempString, length, &ds); Tcl_DecrRefCount(tempPath); handle = FindFirstFile(nativeName, &data); if (handle == INVALID_HANDLE_VALUE) { |