read stdin if arg is exactly "-" not just begins with '-'
This commit is contained in:
parent
84b08427a1
commit
148e6e3b79
2
cat.c
2
cat.c
@ -30,7 +30,7 @@ main(int argc, char *argv[])
|
|||||||
concat(stdin, "<stdin>", stdout, "<stdout>");
|
concat(stdin, "<stdin>", stdout, "<stdout>");
|
||||||
} else {
|
} else {
|
||||||
for (; argc; argc--, argv++) {
|
for (; argc; argc--, argv++) {
|
||||||
if (argv[0][0] == '-')
|
if (argv[0][0] == '-' && !argv[0][1])
|
||||||
argv[0] = "/dev/fd/0";
|
argv[0] = "/dev/fd/0";
|
||||||
if (!(fp = fopen(argv[0], "r"))) {
|
if (!(fp = fopen(argv[0], "r"))) {
|
||||||
weprintf("fopen %s:", argv[0]);
|
weprintf("fopen %s:", argv[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user