Skip to content

Commit 7fc01b4

Browse files
committed
Change the example in the readme, exit when file can't be loaded.
1 parent 0102140 commit 7fc01b4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

README

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ You should see some output like:
2727
( 3 ( 1 ( 0 . 0 ) 1 ( 0 . 0 ) 17 5 ) 4 21 )
2828

2929
Then run it, with no second argument lispkit will read the input
30-
from stdin. Type a number e.g. 9, press enter, then ctrl-d, and
31-
the result will be printed to stdout:
30+
from stdin.
3231

33-
./lispkit examples/square.o
34-
9
35-
81
32+
echo 5 | ./lispkit examples/square.o
33+
25
3634

main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ main(int argc, char *argv[])
7373
fp[fpi] = fopen(argv[arg], "ra");
7474
if (fp[fpi] == NULL || ferror(fp[fpi]) != 0) {
7575
printf("Could not load '%s': %s\n", argv[arg], strerror(errno));
76+
exit(-1);
7677
}
7778
}
7879

0 commit comments

Comments
 (0)