diff options
| author | Christoph Lohmann <20h@r-36.net> | 2012-09-06 00:00:50 +0200 |
|---|---|---|
| committer | Christoph Lohmann <20h@r-36.net> | 2012-09-06 00:00:50 +0200 |
| commit | a1cd28f8099eac3938461f9e63ff6b74d4d824ef (patch) | |
| tree | 005debb669f3bbc5a6c259cc4ac0d94c123cd153 | |
| parent | Adding instantenous debug output and fixing italic with a reset. (diff) | |
| download | st-a1cd28f8099eac3938461f9e63ff6b74d4d824ef.tar.gz st-a1cd28f8099eac3938461f9e63ff6b74d4d824ef.zip | |
Allow simpler stdout -f handling.
| -rw-r--r-- | st.c | 12 |
1 files changed, 9 insertions, 3 deletions
| @@ -801,9 +801,15 @@ ttynew(void) { | |||
| 801 | close(s); | 801 | close(s); |
| 802 | cmdfd = m; | 802 | cmdfd = m; |
| 803 | signal(SIGCHLD, sigchld); | 803 | signal(SIGCHLD, sigchld); |
| 804 | if(opt_io && !(fileio = fopen(opt_io, "w"))) { | 804 | if(opt_io) { |
| 805 | fprintf(stderr, "Error opening %s:%s\n", | 805 | if(!strcmp(opt_io, "-")) { |
| 806 | opt_io, strerror(errno)); | 806 | fileio = stdout; |
| 807 | } else { | ||
| 808 | if(!(fileio = fopen(opt_io, "w"))) { | ||
| 809 | fprintf(stderr, "Error opening %s:%s\n", | ||
| 810 | opt_io, strerror(errno)); | ||
| 811 | } | ||
| 812 | } | ||
| 807 | } | 813 | } |
| 808 | } | 814 | } |
| 809 | } | 815 | } |
