cat: accept - as an argument

This commit is contained in:
K. Lange 2018-10-29 13:47:05 +09:00
parent d26129ce39
commit 8d5c2aeb5a

View File

@ -36,6 +36,10 @@ int main(int argc, char ** argv) {
}
for (int i = 1; i < argc; ++i) {
if (!strcmp(argv[i],"-")) {
doit(0);
continue;
}
int fd = open(argv[i], O_RDONLY);
if (fd < 0) {
fprintf(stderr, "%s: %s: %s\n", argv[0], argv[i], strerror(errno));