vim-patch:7.4.656

Problem:    Missing changes for glob() in one file.
Solution:   Add the missing changes.

d8b77f7dc0
This commit is contained in:
Justin Gassner
2016-01-25 19:36:57 +01:00
parent 45b378259e
commit 299044d4ef
9 changed files with 427 additions and 37 deletions

View File

@@ -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 */