vim-patch:8.1.0806: too many #ifdefs

Problem:    Too many #ifdefs.
Solution:   Graduate FEAT_MBYTE, part 2.
fc3abf47fb
This commit is contained in:
Jan Edmund Lazo
2020-11-12 00:43:14 -05:00
parent 54495c9816
commit e2504d2192
7 changed files with 72 additions and 96 deletions

View File

@@ -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;