-envlist: /* empty */ {
- if (!($$.envlist = calloc(1, sizeof(char *))))
- errx(1, "can't allocate envlist");
- } | envlist TSTRING {
- int nenv = arraylen($1.envlist);
- if (!($$.envlist = reallocarray($1.envlist, nenv + 2, sizeof(char *))))
- errx(1, "can't allocate envlist");
- $$.envlist[nenv] = $2.str;
- $$.envlist[nenv + 1] = NULL;
- }
+strlist: /* empty */ {
+ if (!($$.strlist = calloc(1, sizeof(char *))))
+ errx(1, "can't allocate strlist");
+ } | strlist TSTRING {
+ int nstr = arraylen($1.strlist);
+ if (!($$.strlist = reallocarray($1.strlist, nstr + 2,
+ sizeof(char *))))
+ errx(1, "can't allocate strlist");
+ $$.strlist[nstr] = $2.str;
+ $$.strlist[nstr + 1] = NULL;
+ } ;