diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-01-27 23:41:19 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-01-27 23:41:19 -0500 |
commit | 164fb2a688b8ce992acf3f9b50f154c14f670285 (patch) | |
tree | 45c475d1e439a66347b218f33510e7cc6a8e3e5f /src | |
parent | d459a0891cfafbbb9e4a36af2a3e77ced96983f2 (diff) | |
parent | 299044d4efff0f3ea0ae910977ebe77099cfebf4 (diff) | |
download | rneovim-164fb2a688b8ce992acf3f9b50f154c14f670285.tar.gz rneovim-164fb2a688b8ce992acf3f9b50f154c14f670285.tar.bz2 rneovim-164fb2a688b8ce992acf3f9b50f154c14f670285.zip |
Merge pull request #4098 from jusga/vim-7.4.656
vim-patch:7.4.656
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/path.c | 39 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 24 insertions, 17 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index 5ac3d07f67..8b9a49dfc0 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -681,11 +681,16 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, /* remove backslashes for the remaining components only */ (void)do_path_expand(gap, buf, len + 1, flags, false); } else { - /* no more wildcards, check if there is a match */ - /* remove backslashes for the remaining components only */ - if (*path_end != NUL) + FileInfo file_info; + + // 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 (os_file_exists(buf)) { /* add existing file */ + } + // add existing file or symbolic link + if ((flags & EW_ALLLINKS) ? os_fileinfo_link((char *)buf, &file_info) + : os_file_exists(buf)) { addfile(gap, buf, flags); } } @@ -1294,26 +1299,28 @@ expand_backtick ( return cnt; } -/* - * Add a file to a file list. Accepted flags: - * EW_DIR add directories - * EW_FILE add files - * EW_EXEC add executable files - * EW_NOTFOUND add even when it doesn't exist - * EW_ADDSLASH add slash after directory name - */ -void -addfile ( +// Add a file to a file list. Accepted flags: +// EW_DIR add directories +// EW_FILE add files +// 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( garray_T *gap, char_u *f, /* filename */ int flags ) { bool isdir; + FileInfo file_info; - /* if the file/dir doesn't exist, may not add it */ - if (!(flags & EW_NOTFOUND) && !os_file_exists(f)) + // if the file/dir/link doesn't exist, may not add it + if (!(flags & EW_NOTFOUND) && + ((flags & EW_ALLLINKS) ? + !os_fileinfo_link((char *)f, &file_info) : !os_file_exists(f))) { return; + } #ifdef FNAME_ILLEGAL /* if the file/dir contains illegal characters, don't add it */ diff --git a/src/nvim/version.c b/src/nvim/version.c index dcd1773a7a..5b22fbe7fa 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -468,7 +468,7 @@ static int included_patches[] = { 659, 658, // 657 NA - // 656, + 656, 655, 654, 653, |