Commit 25f3827e authored by Stefano Sabatini's avatar Stefano Sabatini

tools/ffeval: do not use UNIX-specific /dev/std{in,out} files

Should fix behavior when the /dev/ directory is not defined (e.g. on
Windows).
parent 7ca102a7
......@@ -83,17 +83,23 @@ int main(int argc, char **argv)
}
}
if (!infilename || !strcmp(infilename, "-"))
infilename = "/dev/stdin";
infile = fopen(infilename, "r");
if (!infilename || !strcmp(infilename, "-")) {
infilename = "stdin";
infile = stdin;
} else {
infile = fopen(infilename, "r");
}
if (!infile) {
fprintf(stderr, "Impossible to open input file '%s': %s\n", infilename, strerror(errno));
return 1;
}
if (!outfilename || !strcmp(outfilename, "-"))
outfilename = "/dev/stdout";
outfile = fopen(outfilename, "w");
if (!outfilename || !strcmp(outfilename, "-")) {
outfilename = "stdout";
outfile = stdout;
} else {
outfile = fopen(outfilename, "w");
}
if (!outfile) {
fprintf(stderr, "Impossible to open output file '%s': %s\n", outfilename, strerror(errno));
return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment