No OOM in ExpandOldSetting()

This commit is contained in:
Felipe Oliveira Carvalho
2014-05-31 00:48:14 -03:00
parent b1595e74f2
commit f4002c97dc
2 changed files with 7 additions and 7 deletions

View File

@@ -3651,8 +3651,10 @@ ExpandFromContext (
expand_shellcmd(pat, num_file, file, flags); expand_shellcmd(pat, num_file, file, flags);
return OK; return OK;
} }
if (xp->xp_context == EXPAND_OLD_SETTING) if (xp->xp_context == EXPAND_OLD_SETTING) {
return ExpandOldSetting(num_file, file); ExpandOldSetting(num_file, file);
return OK;
}
if (xp->xp_context == EXPAND_BUFFERS) if (xp->xp_context == EXPAND_BUFFERS)
return ExpandBufnames(pat, num_file, file, options); return ExpandBufnames(pat, num_file, file, options);
if (xp->xp_context == EXPAND_TAGS if (xp->xp_context == EXPAND_TAGS

View File

@@ -7384,10 +7384,9 @@ int ExpandSettings(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***
return OK; 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 *var = NULL;
char_u *buf;
*num_file = 0; *num_file = 0;
*file = (char_u **)xmalloc(sizeof(char_u *)); *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 /* A backslash is required before some characters. This is the reverse of
* what happens in do_set(). */ * 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 #ifdef BACKSLASH_IN_FILENAME
/* For MS-Windows et al. we don't double backslashes at the start and /* 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; *file[0] = buf;
*num_file = 1; *num_file = 1;
return OK;
} }
/* /*