mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +00:00
vim-patch:8.1.0806: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate FEAT_MBYTE, part 2.
fc3abf47fb
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user