Better error message when trying to use -R on an unknown module.

This commit is contained in:
Alex Shinn 2014-07-20 09:25:47 +09:00
parent 536f9bfa90
commit 52de854b25

5
main.c
View file

@ -590,6 +590,11 @@ void run_main (int argc, char **argv) {
env = check_exception(ctx, sexp_eval_string(ctx, impmod, -1, sexp_meta_env(ctx))); env = check_exception(ctx, sexp_eval_string(ctx, impmod, -1, sexp_meta_env(ctx)));
if (sexp_vectorp(env)) env = sexp_vector_ref(env, SEXP_ONE); if (sexp_vectorp(env)) env = sexp_vector_ref(env, SEXP_ONE);
free(impmod); free(impmod);
check_exception(ctx, env);
if (!sexp_envp(env)) {
fprintf(stderr, "couldn't find module: %s\n", main_module);
exit_failure();
}
} else } else
#endif #endif
if (i < argc && !no_script) { /* script usage */ if (i < argc && !no_script) { /* script usage */