Use /dev/fd/0 as opposed to /dev/stdin

This commit is contained in:
sin 2014-07-04 23:10:14 +01:00
parent f02f2190f0
commit 5df631ac09

2
cat.c
View File

@ -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;