summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-05-20 10:38:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-05-20 10:38:13 -0700
commite25bbb34fc0b4ed7efb49b3059c902db960372c7 (patch)
tree77c37325e1c15790e0b74527399fdf4e701424ad /eval.c
parent0d3a7519e81dc9eb26d550393bb5d988dad645bf (diff)
downloadtxr-e25bbb34fc0b4ed7efb49b3059c902db960372c7.tar.gz
txr-e25bbb34fc0b4ed7efb49b3059c902db960372c7.tar.bz2
txr-e25bbb34fc0b4ed7efb49b3059c902db960372c7.zip
load: always bind *load-path* to actual path.
* eval.c (load): Bind *load-path* to the real path that was used to open the file, not to the tentative path to which the .tl suffix was added, subject to compatibility option. * txr.1: Documentation for load revised for better wording and to document the above change. Fixed *load-path* being wrongly called a macro, and also load being called a macro. Compat note added.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index ef05a682..f039ed2e 100644
--- a/eval.c
+++ b/eval.c
@@ -4342,7 +4342,9 @@ val load(val target)
uw_simple_catch_begin;
dyn_env = make_env(nil, nil, dyn_env);
- env_vbind(dyn_env, load_path_s, path);
+ env_vbind(dyn_env, load_path_s, if3(opt_compat && opt_compat <= 215,
+ path,
+ stream_get_prop(stream, name_k)));
env_vbind(dyn_env, load_recursive_s, t);
env_vbind(dyn_env, package_s, cur_package);