~ubuntu-branches/ubuntu/raring/tcl8.5/raring

« back to all changes in this revision

Viewing changes to generic/tclFCmd.c

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-03-01 10:35:30 UTC
  • mfrom: (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090301103530-0nvyl18uo9sbu9wh
Tags: 8.5.6-3
Don't remove tclsh alternative in case of package upgrade because the
manually installed alternative is also removed which isn't desirable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 * See the file "license.terms" for information on usage and redistribution of
10
10
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
11
 *
12
 
 * RCS: @(#) $Id: tclFCmd.c,v 1.43 2007/12/13 15:23:17 dgp Exp $
 
12
 * RCS: @(#) $Id: tclFCmd.c,v 1.43.2.1 2008/07/21 14:56:10 patthoyts Exp $
13
13
 */
14
14
 
15
15
#include "tclInt.h"
522
522
        }
523
523
 
524
524
        /*
525
 
         * Prevent copying or renaming a file onto itself. Under Windows, stat
526
 
         * always returns 0 for st_ino. However, the Windows-specific code
527
 
         * knows how to deal with copying or renaming a file on top of itself.
528
 
         * It might be a good idea to write a stat that worked.
 
525
         * Prevent copying or renaming a file onto itself. On Windows since
 
526
         * 8.5 we do get an inode number, however the unsigned short field is
 
527
         * insufficient to accept the Win32 API file id so it is truncated to
 
528
         * 16 bits and we get collisions. See bug #2015723.
529
529
         */
530
530
 
 
531
#ifndef WIN32
531
532
        if ((sourceStatBuf.st_ino != 0) && (targetStatBuf.st_ino != 0)) {
532
533
            if ((sourceStatBuf.st_ino == targetStatBuf.st_ino) &&
533
534
                    (sourceStatBuf.st_dev == targetStatBuf.st_dev)) {
535
536
                goto done;
536
537
            }
537
538
        }
 
539
#endif
538
540
 
539
541
        /*
540
542
         * Prevent copying/renaming a file onto a directory and vice-versa.