diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-17 15:56:34 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-17 15:56:34 +0100 |
commit | 43a34f9f74fdce462fa250baab620264c28b6165 (patch) | |
tree | 4626c150935791d87ea175fa662d40b79e4ba634 /src/fileio.c | |
parent | 4119cf80e1e534057680f9543e73edf7967c2440 (diff) | |
download | vim-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.c | 14 |
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); |