Overview
| Artifact ID: | 49371573a6be91420cd1ea3f117080b18e67edcd |
|---|---|
| Ticket: | 747575ffffffffffffffffffffffffffffffffff
WinNT - [file rename] incorrect error message |
| User & Date: | jgodfrey on 2003-06-02 15:01:30 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
System: ActiveTcl 8.4.2 / WinNT - In a Windows command window, create a directory. Say.... "temp" - Now, cd into the new temp directory (to tie it up) - Now, in a tclsh (actually, wish console window in my case), try to rename the temp directory to "temp1" (jgodfrey) 8 % file rename -force -- temp temp1 error renaming "temp" to "temp1": trying to rename a volume or move a directory into itself (jgodfrey) 9 % "trying to move a directory into itself"? Huh? That can't be right... - Now, try to rename temp to a name that doesn't itself begin with "temp"... (jgodfrey) 9 % file rename -force -- temp newdir error renaming "temp" to "newdir": permission denied (jgodfrey) 10 % Ahhh, a more sensible message... The problem seems to be in "tclWinFCmd.c" in the following code: src = Tcl_WinTCharToUtf((TCHAR *) nativeSrcPath, -1, &srcString); dst = Tcl_WinTCharToUtf((TCHAR *) nativeDstPath, -1, &dstString); if (strncmp(src, dst, (size_t) Tcl_DStringLength(&srcString)) == 0) { /* * Trying to move a directory into itself. */ The source and destination are compared, but only out to the length of the source string. There seems to be more needed in this check, although I'm not sure what the "safest" fix is... - foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "jgodfrey"
- subsystem changed to: "17. Commands I-L"
- title changed to: "WinNT - [file rename] incorrect error message"
- type changed to: "Bug"