diff options
author | Andy Wingo <wingo@pobox.com> | 2012-01-10 00:41:42 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-01-10 00:41:42 +0100 |
commit | 91ee7515da0bad91330ce5c87b250d6cf12a2789 (patch) | |
tree | ce023c92c0d9bf895c1265b107b270c35ba59b94 /libguile/load.c | |
parent | 0bdd43515eb3c62839512181cf33e5aea383e661 (diff) | |
parent | 0e947e1d14597651c5762a4209225c472bdaef45 (diff) | |
download | guile-91ee7515da0bad91330ce5c87b250d6cf12a2789.tar.gz |
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
libguile/__scm.h
libguile/array-map.c
libguile/procprop.c
libguile/tags.h
module/ice-9/deprecated.scm
module/ice-9/psyntax-pp.scm
module/ice-9/psyntax.scm
test-suite/standalone/test-num2integral.c
test-suite/tests/regexp.test
Diffstat (limited to 'libguile/load.c')
-rw-r--r-- | libguile/load.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libguile/load.c b/libguile/load.c index b28e30b2a..135a621cb 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -87,7 +87,9 @@ SCM_DEFINE (scm_primitive_load, "primitive-load", 1, 0, 0, #define FUNC_NAME s_scm_primitive_load { SCM hook = *scm_loc_load_hook; + SCM ret = SCM_UNSPECIFIED; char *encoding; + SCM_VALIDATE_STRING (1, filename); if (scm_is_true (hook) && scm_is_false (scm_procedure_p (hook))) SCM_MISC_ERROR ("value of %load-hook is neither a procedure nor #f", @@ -96,8 +98,10 @@ SCM_DEFINE (scm_primitive_load, "primitive-load", 1, 0, 0, if (!scm_is_false (hook)) scm_call_1 (hook, filename); - { /* scope */ - SCM port = scm_open_file (filename, scm_from_locale_string ("r")); + { + SCM port; + + port = scm_open_file (filename, scm_from_locale_string ("r")); scm_dynwind_begin (SCM_F_DYNWIND_REWINDABLE); scm_i_dynwind_current_load_port (port); @@ -124,13 +128,13 @@ SCM_DEFINE (scm_primitive_load, "primitive-load", 1, 0, 0, if (SCM_EOF_OBJECT_P (form)) break; - scm_primitive_eval_x (form); + ret = scm_primitive_eval_x (form); } scm_dynwind_end (); scm_close_port (port); } - return SCM_UNSPECIFIED; + return ret; } #undef FUNC_NAME |