diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-26 18:42:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-26 18:42:19 -0400 |
commit | b6897ebc0c623d0a74c221c3030c7eaf17b7e151 (patch) | |
tree | 87aafbbea8cc03bc9250f2710f1dd2e1971af01f /src/nvim/ex_getln.c | |
parent | a22fe09b90a52f451d9fd8d3372b8c390dd1dc1a (diff) | |
parent | 6a0cb2a948cd7b523a2dc545b165acf6f44d10fb (diff) | |
download | rneovim-b6897ebc0c623d0a74c221c3030c7eaf17b7e151.tar.gz rneovim-b6897ebc0c623d0a74c221c3030c7eaf17b7e151.tar.bz2 rneovim-b6897ebc0c623d0a74c221c3030c7eaf17b7e151.zip |
Merge pull request #13116 from skippi/vim-8.1.1769
vim-patch:8.1.{1769, 1772, 1791},8.2.{1747}
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 940f446a7b..d67e9b2d7e 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -4990,7 +4990,7 @@ ExpandFromContext ( char_u *pat, int *num_file, char_u ***file, - int options /* EW_ flags */ + int options // WILD_ flags ) { regmatch_T regmatch; @@ -5052,6 +5052,21 @@ ExpandFromContext ( ret = expand_wildcards_eval(&pat, num_file, file, flags); if (free_pat) xfree(pat); +#ifdef BACKSLASH_IN_FILENAME + if (p_csl[0] != NUL && (options & WILD_IGNORE_COMPLETESLASH) == 0) { + for (int i = 0; i < *num_file; i++) { + char_u *ptr = (*file)[i]; + while (*ptr != NUL) { + if (p_csl[0] == 's' && *ptr == '\\') { + *ptr = '/'; + } else if (p_csl[0] == 'b' && *ptr == '/') { + *ptr = '\\'; + } + ptr += utfc_ptr2len(ptr); + } + } + } +#endif return ret; } |