diff options
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 57b0cf9a31..b169899cea 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -26,6 +26,7 @@ #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/farsi.h" +#include "nvim/func_attr.h" #include "nvim/main.h" #include "nvim/mbyte.h" #include "nvim/memline.h" @@ -2584,7 +2585,7 @@ int input_available(void) * Return 0 for success * 1 for invalid arguments * 2 for no match - * 4 for out of mem + * 4 for out of mem (deprecated, WON'T HAPPEN) * 5 for entry not unique */ int @@ -3724,10 +3725,6 @@ eval_map_expr ( vim_unescape_csi(expr); save_cmd = save_cmdline_alloc(); - if (save_cmd == NULL) { - free(expr); - return NULL; - } /* Forbid changing text or using ":normal" to avoid most of the bad side * effects. Also restore the cursor position. */ @@ -3764,17 +3761,13 @@ static bool is_user_input(int k) /* * Copy "p" to allocated memory, escaping K_SPECIAL and CSI so that the result * can be put in the typeahead buffer. - * Returns NULL when out of memory. */ char_u *vim_strsave_escape_csi(char_u *p) { - char_u *res; - char_u *s, *d; - /* Need a buffer to hold up to three times as much. */ - res = xmalloc(STRLEN(p) * 3 + 1); - d = res; - for (s = p; *s != NUL; ) { + char_u *res = xmalloc(STRLEN(p) * 3 + 1); + char_u *d = res; + for (char_u *s = p; *s != NUL; ) { if (s[0] == K_SPECIAL && s[1] != NUL && s[2] != NUL) { /* Copy special key unmodified. */ *d++ = *s++; |