diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-05-10 01:31:55 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-05-10 01:31:55 -0400 |
commit | a2b888d3830de97eb093a29c930851ceacbd454a (patch) | |
tree | e34d9e296aec716ba607ab4f02f877cd4163f356 /src/nvim/path.c | |
parent | d06c4a239131a84637c5c7d247ef8b5e9c7275b3 (diff) | |
parent | 691e3bbc99af6e4ef9a1649e02b8fa302e4f5732 (diff) | |
download | rneovim-a2b888d3830de97eb093a29c930851ceacbd454a.tar.gz rneovim-a2b888d3830de97eb093a29c930851ceacbd454a.tar.bz2 rneovim-a2b888d3830de97eb093a29c930851ceacbd454a.zip |
Merge pull request #4695 from KillTheMule/vim-7.4.896
vim-patch:7.4.896
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index aff0ee2d48..41fd69f238 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1284,6 +1284,29 @@ static int expand_backtick( return cnt; } +#ifdef BACKSLASH_IN_FILENAME +/// Replace all slashes by backslashes. +/// This used to be the other way around, but MS-DOS sometimes has problems +/// with slashes (e.g. in a command name). We can't have mixed slashes and +/// backslashes, because comparing file names will not work correctly. The +/// commands that use a file name should try to avoid the need to type a +/// backslash twice. +/// When 'shellslash' set do it the other way around. +/// When the path looks like a URL leave it unmodified. +void slash_adjust(char_u *p) +{ + if (path_with_url(p)) { + return; + } + while (*p) { + if (*p == psepcN) { + *p = psepc; + } + mb_ptr_adv(p); + } +} +#endif + // Add a file to a file list. Accepted flags: // EW_DIR add directories // EW_FILE add files |