- if (item->val.alistval == NULL) {
- list = New(alist(10, owned_by_alist));
- } else {
- list = item->val.alistval;
+ for (;;) {
+ if (lex_get_token(lc, T_STRING) == T_ERROR) {
+ return false;
+ }
+
+ if (list == NULL) {
+ list = New(alist(10, owned_by_alist));
+ }
+ list->append(bstrdup(lc->str));
+
+ if (lc->ch != ',') { /* if no other item follows */
+ if (!lex_check_eol(lc)) {
+ /* found garbage at the end of the line */
+ return false;
+ }
+ break; /* get out */
+ }
+ lex_get_token(lc, T_ALL); /* eat comma */