Allow simpler stdout -f handling.
Christoph Lohmann 20h@r-36.net
1 files changed,
9 insertions(+),
3 deletions(-)
jump to
M
st.c
→
st.c
@@ -801,9 +801,15 @@ default:
close(s); cmdfd = m; signal(SIGCHLD, sigchld); - if(opt_io && !(fileio = fopen(opt_io, "w"))) { - fprintf(stderr, "Error opening %s:%s\n", - opt_io, strerror(errno)); + if(opt_io) { + if(!strcmp(opt_io, "-")) { + fileio = stdout; + } else { + if(!(fileio = fopen(opt_io, "w"))) { + fprintf(stderr, "Error opening %s:%s\n", + opt_io, strerror(errno)); + } + } } } }