pinosaur
/
st.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2da43a
)
Allow simpler stdout -f handling.
author
Christoph Lohmann
<20h@r-36.net>
Wed, 5 Sep 2012 22:00:50 +0000
(
00:00
+0200)
committer
Christoph Lohmann
<20h@r-36.net>
Wed, 5 Sep 2012 22:00:50 +0000
(
00:00
+0200)
st.c
patch
|
blob
|
history
diff --git
a/st.c
b/st.c
index
fd5e0fd
..
7852de0
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-801,9
+801,15
@@
ttynew(void) {
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));
+ }
+ }
}
}
}