Use /dev/fd/0 as opposed to /dev/stdin
This commit is contained in:
parent
f02f2190f0
commit
5df631ac09
2
cat.c
2
cat.c
@ -30,7 +30,7 @@ main(int argc, char *argv[])
|
|||||||
for(i = 0; i < argc; i++) {
|
for(i = 0; i < argc; i++) {
|
||||||
p = argv[i];
|
p = argv[i];
|
||||||
if (argv[i][0] == '-')
|
if (argv[i][0] == '-')
|
||||||
p = "/dev/stdin";
|
p = "/dev/fd/0";
|
||||||
if(!(fp = fopen(p, "r"))) {
|
if(!(fp = fopen(p, "r"))) {
|
||||||
weprintf("fopen %s:", argv[i]);
|
weprintf("fopen %s:", argv[i]);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user