mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
No error condition in get_arg_list()
This commit is contained in:
parent
a583bcc76e
commit
a5efbd3140
@ -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
|
* Separate the arguments in "str" and return a list of pointers in the
|
||||||
* growarray "gap".
|
* 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);
|
ga_init(gap, (int)sizeof(char_u *), 20);
|
||||||
while (*str != NUL) {
|
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. */
|
/* Isolate one argument, change it in-place, put a NUL after it. */
|
||||||
str = do_one_arg(str);
|
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;
|
garray_T ga;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (get_arglist(&ga, str) == FAIL)
|
get_arglist(&ga, str);
|
||||||
return FAIL;
|
|
||||||
if (wig == TRUE)
|
if (wig == TRUE)
|
||||||
i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
|
i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
|
||||||
fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
|
fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
|
||||||
@ -1600,8 +1599,7 @@ do_arglist (
|
|||||||
/*
|
/*
|
||||||
* Collect all file name arguments in "new_ga".
|
* Collect all file name arguments in "new_ga".
|
||||||
*/
|
*/
|
||||||
if (get_arglist(&new_ga, str) == FAIL)
|
get_arglist(&new_ga, str);
|
||||||
return FAIL;
|
|
||||||
|
|
||||||
if (what == AL_DEL) {
|
if (what == AL_DEL) {
|
||||||
regmatch_T regmatch;
|
regmatch_T regmatch;
|
||||||
@ -1934,7 +1932,6 @@ void ex_argedit(exarg_T *eap)
|
|||||||
return;
|
return;
|
||||||
i = alist_add_list(1, &s,
|
i = alist_add_list(1, &s,
|
||||||
eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1);
|
eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1);
|
||||||
|
|
||||||
curwin->w_arg_idx = i;
|
curwin->w_arg_idx = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ int can_abandon(buf_T *buf, int forceit);
|
|||||||
int check_changed_any(int hidden);
|
int check_changed_any(int hidden);
|
||||||
int check_fname(void);
|
int check_fname(void);
|
||||||
int buf_write_all(buf_T *buf, int forceit);
|
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 get_arglist_exp(char_u *str, int *fcountp, char_u ***fnamesp,
|
||||||
int wig);
|
int wig);
|
||||||
void set_arglist(char_u *str);
|
void set_arglist(char_u *str);
|
||||||
|
Loading…
Reference in New Issue
Block a user