diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-31 00:48:14 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-06-16 01:40:28 -0300 |
commit | f4002c97dc36e817a59b5e18c852d1a17e775c1c (patch) | |
tree | 686c2690fe42eab952750bfbf26c32a85a7c07fb | |
parent | b1595e74f2811b8fb5f04aa14ef80dbe3b69ae73 (diff) | |
download | rneovim-f4002c97dc36e817a59b5e18c852d1a17e775c1c.tar.gz rneovim-f4002c97dc36e817a59b5e18c852d1a17e775c1c.tar.bz2 rneovim-f4002c97dc36e817a59b5e18c852d1a17e775c1c.zip |
No OOM in ExpandOldSetting()
-rw-r--r-- | src/nvim/ex_getln.c | 6 | ||||
-rw-r--r-- | src/nvim/option.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 959dfd1584..02c82eaf21 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -3651,8 +3651,10 @@ ExpandFromContext ( expand_shellcmd(pat, num_file, file, flags); return OK; } - if (xp->xp_context == EXPAND_OLD_SETTING) - return ExpandOldSetting(num_file, file); + if (xp->xp_context == EXPAND_OLD_SETTING) { + ExpandOldSetting(num_file, file); + return OK; + } if (xp->xp_context == EXPAND_BUFFERS) return ExpandBufnames(pat, num_file, file, options); if (xp->xp_context == EXPAND_TAGS diff --git a/src/nvim/option.c b/src/nvim/option.c index c14edd1a9c..8390efe979 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -7384,10 +7384,9 @@ int ExpandSettings(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u *** return OK; } -int ExpandOldSetting(int *num_file, char_u ***file) +void ExpandOldSetting(int *num_file, char_u ***file) { - char_u *var = NULL; /* init for GCC */ - char_u *buf; + char_u *var = NULL; *num_file = 0; *file = (char_u **)xmalloc(sizeof(char_u *)); @@ -7410,7 +7409,7 @@ int ExpandOldSetting(int *num_file, char_u ***file) /* A backslash is required before some characters. This is the reverse of * what happens in do_set(). */ - buf = vim_strsave_escaped(var, escape_chars); + char_u *buf = vim_strsave_escaped(var, escape_chars); #ifdef BACKSLASH_IN_FILENAME /* For MS-Windows et al. we don't double backslashes at the start and @@ -7426,7 +7425,6 @@ int ExpandOldSetting(int *num_file, char_u ***file) *file[0] = buf; *num_file = 1; - return OK; } /* |