aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-11-14 19:35:26 +0100
committerGitHub <noreply@github.com>2020-11-14 19:35:26 +0100
commit27d630926cab78511075159012ce6ac920d8747e (patch)
treedb9afbe90762056b2f2c538744ce04d571108b89 /src/nvim/path.c
parentd8c69adbabe963142f433a2ddad172ff46413f15 (diff)
parent5d6ecfa3c7447009da75842c611ea1b9f1db83e7 (diff)
downloadrneovim-27d630926cab78511075159012ce6ac920d8747e.tar.gz
rneovim-27d630926cab78511075159012ce6ac920d8747e.tar.bz2
rneovim-27d630926cab78511075159012ce6ac920d8747e.zip
Merge pull request #13275 from janlazo/vim-8.1.0805
vim-patch:8.1.{805,806,809,810,811}
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c23
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;