*/
while (--argc) {
char *p = *++argv;
- if (*p == '-') {
+ if (*p == '-' && p[1]) {
/*
* An option.
*/
/*
* A non-option argument.
*/
- infiles[nfiles++] = p;
+ if (!strcmp(p, "-"))
+ infiles[nfiles++] = NULL; /* special case: read stdin */
+ else
+ infiles[nfiles++] = p;
}
}