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/fileio.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/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 6c0bc59d93..db1469db97 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5097,19 +5097,23 @@ void write_lnum_adjust(linenr_T offset) } #if defined(BACKSLASH_IN_FILENAME) -/* - * Convert all backslashes in fname to forward slashes in-place. - */ +/// Convert all backslashes in fname to forward slashes in-place, +/// unless when it looks like a URL. void forward_slash(char_u *fname) { char_u *p; - for (p = fname; *p != NUL; ++p) - /* The Big5 encoding can have '\' in the trail byte. */ - if (enc_dbcs != 0 && (*mb_ptr2len)(p) > 1) - ++p; - else if (*p == '\\') + if (path_with_url(fname)) { + return; + } + for (p = fname; *p != NUL; p++) { + // The Big5 encoding can have '\' in the trail byte. + if (enc_dbcs != 0 && (*mb_ptr2len)(p) > 1) { + p++; + } else if (*p == '\\') { *p = '/'; + } + } } #endif |