diff options
-rw-r--r-- | src/nvim/fileio.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 6030f388d5..db1469db97 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5106,12 +5106,14 @@ void forward_slash(char_u *fname) 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 == '\\') + 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 |