Unified · Split
| @@ -41,9 +41,12 @@ main(int argc, char **argv) · 40 unmodified lines | ||
| 41 | 41 | curctx = ctx; |
| 42 | 42 | notify(onnote); |
| 43 | 43 | |
| 44 | − if(argc > 1 && (fp = Bopen(argv[1], OREAD)) == nil) | |
| 45 | − aa_error(ctx, "could not open input file"); | |
| 46 | − else{ | |
| 44 | + if(argc > 1){ | |
| 45 | + if((fp = Bopen(argv[1], OREAD)) == nil) | |
| 46 | + aa_error(ctx, "could not open input file"); | |
| 47 | + else | |
| 48 | + ctx->fd[0] = *fp; | |
| 49 | + }else{ | |
| 47 | 50 | fp = &ctx->fd[0]; |
| 48 | 51 | aa_handlers(ctx)->error = onerror; |
| 49 | 52 | } |