summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-03-05 21:21:19 +0100
committerBram Moolenaar <Bram@vim.org>2015-03-05 21:21:19 +0100
commitd8b77f7dc04e5721989df9c505b8568194261a39 (patch)
tree72d2503cfdbab3bde3c461ac3febbff5f06b9675 /src
parentb6c2735c56f1541159e1ad95c3f17a52b3a94f1d (diff)
updated for version 7.4.656v7.4.656
Problem: Missing changes for glob() in one file. Solution: Add the missing changes.
Diffstat (limited to 'src')
-rw-r--r--src/misc1.c13
-rw-r--r--src/version.c2
2 files changed, 12 insertions, 3 deletions
diff --git a/src/misc1.c b/src/misc1.c
index 707abf8d5a..4ff89ad0cc 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -10168,11 +10168,15 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
}
else
{
+ struct stat sb;
+
/* no more wildcards, check if there is a match */
/* remove backslashes for the remaining components only */
if (*path_end != NUL)
backslash_halve(buf + len + 1);
- if (mch_getperm(buf) >= 0) /* add existing file */
+ /* add existing file or symbolic link */
+ if ((flags & EW_ALLLINKS) ? mch_lstat(buf, &sb) >= 0
+ : mch_getperm(buf) >= 0)
{
#ifdef MACOS_CONVERT
size_t precomp_len = STRLEN(buf)+1;
@@ -10919,6 +10923,7 @@ expand_backtick(gap, pat, flags)
* EW_EXEC add executable files
* EW_NOTFOUND add even when it doesn't exist
* EW_ADDSLASH add slash after directory name
+ * EW_ALLLINKS add symlink also when the referred file does not exist
*/
void
addfile(gap, f, flags)
@@ -10928,9 +10933,11 @@ addfile(gap, f, flags)
{
char_u *p;
int isdir;
+ struct stat sb;
- /* if the file/dir doesn't exist, may not add it */
- if (!(flags & EW_NOTFOUND) && mch_getperm(f) < 0)
+ /* if the file/dir/link doesn't exist, may not add it */
+ if (!(flags & EW_NOTFOUND) && ((flags & EW_ALLLINKS)
+ ? mch_lstat(f, &sb) < 0 : mch_getperm(f) < 0))
return;
#ifdef FNAME_ILLEGAL
diff --git a/src/version.c b/src/version.c
index 81f4d4122b..7a3579a6ed 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 656,
+/**/
655,
/**/
654,