summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-03-11 22:46:48 +0000
committerBram Moolenaar <Bram@vim.org>2005-03-11 22:46:48 +0000
commitcd71fa3c1e5749285c3aa08dd9b3aa7b33e9a7fb (patch)
tree36a1983ed08c957e293e17942ab742ce77cdf942 /src/fileio.c
parentdf7b1ffe999e87cc67e23dc423f995cb56bc6fee (diff)
downloadvim-cd71fa3c1e5749285c3aa08dd9b3aa7b33e9a7fb.zip
updated for version 7.0059
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 22ab06d8f..4e5104a67 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5675,6 +5675,9 @@ vim_rename(from, to)
#endif
struct stat st;
long perm;
+#ifdef HAVE_ACL
+ vim_acl_T acl; /* ACL from original file */
+#endif
/*
* When the names are identical, there is nothing to do.
@@ -5726,6 +5729,10 @@ vim_rename(from, to)
* Rename() failed, try copying the file.
*/
perm = mch_getperm(from);
+#ifdef HAVE_ACL
+ /* For systems that support ACL: get the ACL from the original file. */
+ acl = mch_get_acl(from);
+#endif
fd_in = mch_open((char *)from, O_RDONLY|O_EXTRA, 0);
if (fd_in == -1)
return -1;
@@ -5763,6 +5770,9 @@ vim_rename(from, to)
to = from;
}
mch_setperm(to, perm);
+#ifdef HAVE_ACL
+ mch_set_acl(to, acl);
+#endif
if (errmsg != NULL)
{
EMSG2(errmsg, to);