Merge pull request #504 from edw/args

Fix invocation of main caused by fix for #484
This commit is contained in:
Alex Shinn 2018-12-11 22:54:00 +08:00 committed by GitHub
commit e0f23d4286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

2
main.c
View file

@ -614,7 +614,7 @@ sexp run_main (int argc, char **argv) {
sym = sexp_intern(ctx, main_symbol, -1); sym = sexp_intern(ctx, main_symbol, -1);
tmp = sexp_env_ref(ctx, env, sym, SEXP_FALSE); tmp = sexp_env_ref(ctx, env, sym, SEXP_FALSE);
if (sexp_procedurep(tmp)) { if (sexp_procedurep(tmp)) {
args = sexp_list1(ctx, sexp_cdr(args)); args = sexp_list1(ctx, args);
check_exception(ctx, sexp_apply(ctx, tmp, args)); check_exception(ctx, sexp_apply(ctx, tmp, args));
} else { } else {
fprintf(stderr, "couldn't find main binding: %s in %s\n", main_symbol, main_module ? main_module : argv[i]); fprintf(stderr, "couldn't find main binding: %s in %s\n", main_symbol, main_module ? main_module : argv[i]);