# HG changeset patch # User Rob Landley # Date 1213662455 18000 # Node ID 1bb9f53a7101a357e2047e232ad699e4922bf001 # Parent 6e65eefc37e999b378d1eca271bf93011e5f5a25 Assemble '*' repeated argument list in order. Also implement '@' counter. diff -r 6e65eefc37e9 -r 1bb9f53a7101 lib/args.c --- a/lib/args.c Mon May 26 16:07:16 2008 -0500 +++ b/lib/args.c Mon Jun 16 19:27:35 2008 -0500 @@ -121,15 +121,14 @@ error_exit("Missing argument"); if (type == ':') *(opt->arg) = (long)gof->arg; else if (type == '*') { - struct arg_list *temp, **list; + struct arg_list **list; + list = (struct arg_list **)opt->arg; - temp = xmalloc(sizeof(struct arg_list)); - temp->arg = gof->arg; - temp->next = *list; - *list = temp; + while (*list) list=&((*list)->next); + *list = xzalloc(sizeof(struct arg_list)); + (*list)->arg = gof->arg; } else if (type == '#') *(opt->arg) = atolx((char *)gof->arg); - else if (type == '@') { - } + else if (type == '@') ++*(opt->arg); gof->arg = ""; }