*: Partial string handling refactoring

Main points:

- Replace `char_u` with `char` in some cases.
- Remove `str[len] = NUL` hack in some cases when `str` may be considered
  `const`.
This commit is contained in:
ZyX
2016-07-29 21:41:45 +03:00
parent 2a50ff7e2f
commit efa2682e3b
32 changed files with 1289 additions and 1037 deletions

View File

@@ -843,10 +843,10 @@ char_u *replace_termcodes(const char_u *from, const size_t from_len,
// If "mapleader" or "maplocalleader" isn't set use a backslash.
if (end - src >= 7 && STRNICMP(src, "<Leader>", 8) == 0) {
len = 8;
p = get_var_value((char_u *)"g:mapleader");
p = get_var_value("g:mapleader");
} else if (end - src >= 12 && STRNICMP(src, "<LocalLeader>", 13) == 0) {
len = 13;
p = get_var_value((char_u *)"g:maplocalleader");
p = get_var_value("g:maplocalleader");
} else {
len = 0;
p = NULL;