3 * tac.c - output lines in reverse order
5 * Copyright 2012 Rob Landley <rob@landley.net>
9 USE_TAC(NEWTOY(tac, NULL, TOYFLAG_USR|TOYFLAG_BIN))
17 Output lines in reverse order.
22 void do_tac(int fd, char *name)
24 struct arg_list *list = NULL;
29 struct arg_list *temp;
32 if (!(c = get_line(fd))) break;
35 if (len && c[len-1]=='\n') c[len-1] = 0;
36 temp = xmalloc(sizeof(struct arg_list));
44 struct arg_list *temp = list->next;
54 loopfiles(toys.optargs, do_tac);