bash-5.1 beta release

This commit is contained in:
Chet Ramey
2020-09-09 15:25:32 -04:00
parent 712f80b0a4
commit 3eb0018e75
195 changed files with 16779 additions and 14645 deletions
+10 -3
View File
@@ -810,22 +810,29 @@ WORD_LIST *list;
}
char **
array_to_argv (a)
array_to_argv (a, countp)
ARRAY *a;
int *countp;
{
char **ret, *t;
int i;
ARRAY_ELEMENT *ae;
if (a == 0 || array_empty(a))
if (a == 0 || array_empty(a)) {
if (countp)
*countp = 0;
return ((char **)NULL);
}
ret = strvec_create (array_num_elements (a) + 1);
i = 0;
for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) {
t = element_value (ae);
ret[i++] = t ? savestring (t) : (char *)NULL;
if (t)
ret[i++] = savestring (t);
}
ret[i] = (char *)NULL;
if (countp)
*countp = i;
return (ret);
}