From a5efbd3140dd5b40f5212890765aac3847d698ec Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Tue, 8 Apr 2014 01:53:07 -0300 Subject: [PATCH] No error condition in get_arg_list() --- src/ex_cmds2.c | 11 ++++------- src/ex_cmds2.h | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 779c06d928..2bd4a04ffe 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1539,7 +1539,7 @@ static char_u *do_one_arg(char_u *str) * Separate the arguments in "str" and return a list of pointers in the * growarray "gap". */ -int get_arglist(garray_T *gap, char_u *str) +void get_arglist(garray_T *gap, char_u *str) { ga_init(gap, (int)sizeof(char_u *), 20); while (*str != NUL) { @@ -1549,7 +1549,6 @@ int get_arglist(garray_T *gap, char_u *str) /* Isolate one argument, change it in-place, put a NUL after it. */ str = do_one_arg(str); } - return OK; } /* @@ -1562,8 +1561,8 @@ int get_arglist_exp(char_u *str, int *fcountp, char_u ***fnamesp, int wig) garray_T ga; int i; - if (get_arglist(&ga, str) == FAIL) - return FAIL; + get_arglist(&ga, str); + if (wig == TRUE) i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, fcountp, fnamesp, EW_FILE|EW_NOTFOUND); @@ -1600,8 +1599,7 @@ do_arglist ( /* * Collect all file name arguments in "new_ga". */ - if (get_arglist(&new_ga, str) == FAIL) - return FAIL; + get_arglist(&new_ga, str); if (what == AL_DEL) { regmatch_T regmatch; @@ -1934,7 +1932,6 @@ void ex_argedit(exarg_T *eap) return; i = alist_add_list(1, &s, eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1); - curwin->w_arg_idx = i; } diff --git a/src/ex_cmds2.h b/src/ex_cmds2.h index b6e61583bd..eb5ac0547e 100644 --- a/src/ex_cmds2.h +++ b/src/ex_cmds2.h @@ -45,7 +45,7 @@ int can_abandon(buf_T *buf, int forceit); int check_changed_any(int hidden); int check_fname(void); int buf_write_all(buf_T *buf, int forceit); -int get_arglist(garray_T *gap, char_u *str); +void get_arglist(garray_T *gap, char_u *str); int get_arglist_exp(char_u *str, int *fcountp, char_u ***fnamesp, int wig); void set_arglist(char_u *str);