File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -146,15 +146,19 @@ int stdio_redirect(char *dest, int fd) {
146
146
}
147
147
148
148
void configure_stdio () {
149
- outfile = opts .outfile ;
150
- errfile = opts .errfile ;
151
- stdio_redirect (opts .infile , STDIN_FILENO );
152
- stdio_redirect (opts .outfile , STDOUT_FILENO );
153
- if (opts .errfile != NULL ) {
154
- stdio_redirect (opts .errfile , STDERR_FILENO );
149
+ if (opts .infile != NULL ) {
150
+ stdio_redirect (opts .infile , STDIN_FILENO );
155
151
}
156
- else {
157
- stdio_redirect (opts .outfile , STDERR_FILENO );
152
+
153
+ if (opts .outfile != NULL ) {
154
+ stdio_redirect (opts .outfile , STDOUT_FILENO );
155
+
156
+ if (opts .errfile != NULL ) {
157
+ stdio_redirect (opts .errfile , STDERR_FILENO );
158
+ }
159
+ else {
160
+ stdio_redirect (opts .outfile , STDERR_FILENO );
161
+ }
158
162
}
159
163
}
160
164
You can’t perform that action at this time.
0 commit comments