History

repl: fix files as arguments

Sigrid Haflínudóttir committed 6 years ago

Commit d8403a61 parent 7e7bad91 file · +6 −3Browse files

Unified · Split

repl.c+6−3
@@ -41,9 +41,12 @@ main(int argc, char **argv) · 40 unmodified lines
4141 curctx = ctx;
4242 notify(onnote);
4343
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{
4750 fp = &ctx->fd[0];
4851 aa_handlers(ctx)->error = onerror;
4952 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t