summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-17 15:56:34 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-17 15:56:34 +0100
commit43a34f9f74fdce462fa250baab620264c28b6165 (patch)
tree4626c150935791d87ea175fa662d40b79e4ba634 /src/fileio.c
parent4119cf80e1e534057680f9543e73edf7967c2440 (diff)
downloadvim-43a34f9f74fdce462fa250baab620264c28b6165.zip
patch 7.4.1114
Problem: delete() does not work well with symbolic links. Solution: Recognize symbolik links.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 6dbdea21e..f809eb5bc 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -7294,7 +7294,19 @@ delete_recursive(char_u *name)
int i;
char_u *exp;
- if (mch_isdir(name))
+ /* A symbolic link to a directory itself is deleted, not the directory it
+ * points to. */
+ if (
+# if defined(WIN32)
+ mch_isdir(name) && !mch_is_symbolic_link(name)
+# else
+# ifdef UNIX
+ mch_isrealdir(name)
+# else
+ mch_isdir(name)
+# endif
+# endif
+ )
{
vim_snprintf((char *)NameBuff, MAXPATHL, "%s/*", name);
exp = vim_strsave(NameBuff);