case 't': if (*++p || (p = *++av)) ip->eol = *p; else error("Need character after -%s", c); T = (*c == 'T' ? 1 : 0);
case 'P': case 'p': P = (ch == 'P'); ip->pad = 1; break; case 'S': case 's': S = (ch == 'S'); ip->sepstring = optarg; break; case 'T': case 't': T = (ch == 'T'); if (strlen(optarg) != 1) usage(); ip->eol = optarg[0];
getargs(char *av[]){	struct	openfile *ip = input;	char *p;	char *c;	static char fmtbuf[BUFSIZ];	char *fmtp = fmtbuf;	int P, S, F, T;	P = S = F = T = 0;		/* capitalized options */	while ((p = *++av) != NULL) {		if (*p != '-' || !p[1]) {			morefiles++;			if (*p == '-')				ip->fp = stdin;			else if ((ip->fp = fopen(p, "r")) == NULL)				err(1, p);			ip->pad = P;			if (!ip->sepstring)				ip->sepstring = (S ? (ip-1)->sepstring : "");			if (!ip->format)				ip->format = ((P || F) ? (ip-1)->format : "%s");			if (!ip->eol)				ip->eol = (T ? (ip-1)->eol : '\n');			ip++;			continue;		}		switch (*(c = ++p) | 040) {		case 's':			if (*++p || (p = *++av))				ip->sepstring = p;			else				error("Need string after -%s", c);			S = (*c == 'S' ? 1 : 0);			break;		case 't':			if (*++p || (p = *++av))				ip->eol = *p;			else				error("Need character after -%s", c);			T = (*c == 'T' ? 1 : 0);			nofinalnl = 1;			break;		case 'p':			ip->pad = 1;			P = (*c == 'P' ? 1 : 0);		case 'f':			F = (*c == 'F' ? 1 : 0);			if (*++p || (p = *++av)) {				fmtp += strlen(fmtp) + 1;				if (fmtp >= fmtbuf + BUFSIZ)					error("No more format space", "");				snprintf(fmtp, fmtbuf + BUFSIZ - fmtp,				    "%%%ss", p);				ip->format = fmtp;			}			else				error("Need string after -%s", c);			break;		default:			error("What do you mean by -%s?", c);			break;		}	}	ip->fp = NULL;	if (!ip->sepstring)		ip->sepstring = "";}