Allow simpler stdout -f handling.
This commit is contained in:
		
							
								
								
									
										8
									
								
								st.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								st.c
									
									
									
									
									
								
							| @@ -801,12 +801,18 @@ ttynew(void) { | ||||
| 		close(s); | ||||
| 		cmdfd = m; | ||||
| 		signal(SIGCHLD, sigchld); | ||||
| 		if(opt_io && !(fileio = fopen(opt_io, "w"))) { | ||||
| 		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)); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| void | ||||
| dump(char c) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Christoph Lohmann
					Christoph Lohmann