diff options
author | patthoyts <patthoyts@noemail.net> | 2008-07-21 14:56:07 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@noemail.net> | 2008-07-21 14:56:07 (GMT) |
commit | bdab29c948906b2bafe138b8ba39a53c7a78721a (patch) | |
tree | d543de4bda7c3d156444bbb8df16514e7a21ec70 /generic/tclFCmd.c | |
parent | 33ff70d7ded83a1b82ac776fb7622afcb092cce6 (diff) | |
download | tcl-bdab29c948906b2bafe138b8ba39a53c7a78721a.zip tcl-bdab29c948906b2bafe138b8ba39a53c7a78721a.tar.gz tcl-bdab29c948906b2bafe138b8ba39a53c7a78721a.tar.bz2 |
Backported fix for bug #2015723
FossilOrigin-Name: 295579a55510f6cd205739dcb7c0734b5ce060c7
Diffstat (limited to 'generic/tclFCmd.c')
-rw-r--r-- | generic/tclFCmd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index 64782c8..2c99531 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclFCmd.c,v 1.43 2007/12/13 15:23:17 dgp Exp $ + * RCS: @(#) $Id: tclFCmd.c,v 1.43.2.1 2008/07/21 14:56:10 patthoyts Exp $ */ #include "tclInt.h" @@ -522,12 +522,13 @@ CopyRenameOneFile( } /* - * Prevent copying or renaming a file onto itself. Under Windows, stat - * always returns 0 for st_ino. However, the Windows-specific code - * knows how to deal with copying or renaming a file on top of itself. - * It might be a good idea to write a stat that worked. + * Prevent copying or renaming a file onto itself. On Windows since + * 8.5 we do get an inode number, however the unsigned short field is + * insufficient to accept the Win32 API file id so it is truncated to + * 16 bits and we get collisions. See bug #2015723. */ +#ifndef WIN32 if ((sourceStatBuf.st_ino != 0) && (targetStatBuf.st_ino != 0)) { if ((sourceStatBuf.st_ino == targetStatBuf.st_ino) && (sourceStatBuf.st_dev == targetStatBuf.st_dev)) { @@ -535,6 +536,7 @@ CopyRenameOneFile( goto done; } } +#endif /* * Prevent copying/renaming a file onto a directory and vice-versa. |