diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-11-12 00:43:14 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-11-12 01:12:58 -0500 |
commit | e2504d21928325c5379b1e3daf8d7c7bc56f52b0 (patch) | |
tree | 4de381e5d8132a5025833c28a457a244484ef848 /src/nvim/path.c | |
parent | 54495c9816c19d19b10a89825b63b745de6ecfa7 (diff) | |
download | rneovim-e2504d21928325c5379b1e3daf8d7c7bc56f52b0.tar.gz rneovim-e2504d21928325c5379b1e3daf8d7c7bc56f52b0.tar.bz2 rneovim-e2504d21928325c5379b1e3daf8d7c7bc56f52b0.zip |
vim-patch:8.1.0806: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate FEAT_MBYTE, part 2.
https://github.com/vim/vim/commit/fc3abf47fbe1e426f2b676c316c81ee9ff607075
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index 31318f6bea..793f917f06 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -260,13 +260,13 @@ char_u *shorten_dir(char_u *str) *d++ = *s; skip = false; } else if (!skip) { - *d++ = *s; /* copy next char */ - if (*s != '~' && *s != '.') /* and leading "~" and "." */ + *d++ = *s; // copy next char + if (*s != '~' && *s != '.') { // and leading "~" and "." skip = true; - if (has_mbyte) { - int l = mb_ptr2len(s); - while (--l > 0) - *d++ = *++s; + } + int l = utfc_ptr2len(s); + while (--l > 0) { + *d++ = *++s; } } } @@ -608,13 +608,10 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, )) { e = p; } - if (has_mbyte) { - len = (size_t)(*mb_ptr2len)(path_end); - memcpy(p, path_end, len); - p += len; - path_end += len; - } else - *p++ = *path_end++; + len = (size_t)(utfc_ptr2len(path_end)); + memcpy(p, path_end, len); + p += len; + path_end += len; } e = p; *e = NUL; |