aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
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;