patch 7.4.1114
Problem: delete() does not work well with symbolic links.
Solution: Recognize symbolik links.
diff --git a/src/os_unix.c b/src/os_unix.c
index 3619636..d2e1c79 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -2994,7 +2994,7 @@
}
/*
- * return TRUE if "name" is a directory
+ * return TRUE if "name" is a directory or a symlink to a directory
* return FALSE if "name" is not a directory
* return FALSE for error
*/
@@ -3015,6 +3015,28 @@
#endif
}
+/*
+ * return TRUE if "name" is a directory, NOT a symlink to a directory
+ * return FALSE if "name" is not a directory
+ * return FALSE for error
+ */
+ int
+mch_isrealdir(name)
+ char_u *name;
+{
+ struct stat statb;
+
+ if (*name == NUL) /* Some stat()s don't flag "" as an error. */
+ return FALSE;
+ if (lstat((char *)name, &statb))
+ return FALSE;
+#ifdef _POSIX_SOURCE
+ return (S_ISDIR(statb.st_mode) ? TRUE : FALSE);
+#else
+ return ((statb.st_mode & S_IFMT) == S_IFDIR ? TRUE : FALSE);
+#endif
+}
+
static int executable_file __ARGS((char_u *name));
/*