summaryrefslogtreecommitdiffstats
path: root/generic/tclFCmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclFCmd.c')
-rw-r--r--generic/tclFCmd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index a74b6d6..9eb4685 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.29 2004/10/19 21:54:07 dgp Exp $
+ * RCS: @(#) $Id: tclFCmd.c,v 1.30 2005/01/14 14:16:53 dkf Exp $
*/
#include "tclInt.h"
@@ -534,10 +534,13 @@ CopyRenameOneFile(interp, source, target, copyFlag, force)
*/
#if !defined(__WIN32__)
{
- Tcl_Obj* perm = Tcl_NewStringObj("u+w",-1);
- Tcl_IncrRefCount(perm);
- Tcl_FSFileAttrsSet(NULL, 2, target, perm);
- Tcl_DecrRefCount(perm);
+ Tcl_Obj* perm = Tcl_NewStringObj("u+w",-1);
+ int index;
+ Tcl_IncrRefCount(perm);
+ if (TclFSFileAttrIndex(target, "-permissions", &index) == TCL_OK) {
+ Tcl_FSFileAttrsSet(NULL, index, target, perm);
+ }
+ Tcl_DecrRefCount(perm);
}
#endif
}