diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2005-01-14 14:16:51 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2005-01-14 14:16:51 (GMT) |
| commit | 8995a571cf6a66b566743528ffacf44b6cf49f6b (patch) | |
| tree | 7f9d20aefbde66ed75c724de139652dae82026f8 /generic/tclFCmd.c | |
| parent | c58032ce3cf02e57b6a1d112dee3cf9d14fa4c80 (diff) | |
| download | tcl-8995a571cf6a66b566743528ffacf44b6cf49f6b.zip tcl-8995a571cf6a66b566743528ffacf44b6cf49f6b.tar.gz tcl-8995a571cf6a66b566743528ffacf44b6cf49f6b.tar.bz2 | |
Stop reliance on absolute attribute indexes with helper function [Bug 1100671]
Diffstat (limited to 'generic/tclFCmd.c')
| -rw-r--r-- | generic/tclFCmd.c | 13 |
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 } |
