summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-27 06:55:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-27 06:55:23 -0700
commitb47025c3edc0c7a191398d9ceac089011fc80ea1 (patch)
tree942b74d65781522603a00feafc1b8d8c065a51ea
parentf6d726cd185524fef00572b2e18a186926222b29 (diff)
downloadtxr-b47025c3edc0c7a191398d9ceac089011fc80ea1.tar.gz
txr-b47025c3edc0c7a191398d9ceac089011fc80ea1.tar.bz2
txr-b47025c3edc0c7a191398d9ceac089011fc80ea1.zip
Change criterion for *load-path*-relative loading.
* eval.c (load): Do not resolve all relative paths relative to the current *load-path*, only pure relative ones. * match.c (v_load): Likewise. * txr.1: Update doc for @(load)/@(include) and load function.
-rw-r--r--eval.c2
-rw-r--r--match.c2
-rw-r--r--txr.112
3 files changed, 10 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index 463eb7f5..263fa677 100644
--- a/eval.c
+++ b/eval.c
@@ -3347,7 +3347,7 @@ val load(val target)
{
uses_or2;
val parent = or2(load_path, null_string);
- val path = if3(abs_path_p(target),
+ val path = if3(!pure_rel_path_p(target),
target,
cat_str(nappend2(sub_list(split_str(parent, lit("/")),
zero, negone),
diff --git a/match.c b/match.c
index f1c1dba4..85e44b82 100644
--- a/match.c
+++ b/match.c
@@ -3878,7 +3878,7 @@ static val v_load(match_files_ctx *c)
sem_error(specline, lit("~s: null string path given"), sym, nao);
{
- val path = if3(abs_path_p(target),
+ val path = if3(!pure_rel_path_p(target),
target,
cat_str(nappend2(sub_list(split_str(parent, lit("/")),
zero, negone),
diff --git a/txr.1 b/txr.1
index df77876f..b36c12ac 100644
--- a/txr.1
+++ b/txr.1
@@ -7638,13 +7638,15 @@ If the
.code *load-path*
has a current value which is not
.code nil
-and the path is relative, then the path is interpreted relative
+and the path is pure relative according to the
+.code pure-rel-path-p
+function, then the path is interpreted relative
to the directory portion of the path which is stored in
.codn *load-path* .
If
.code *load-path*
-is nil, or the load path is absolute, then it the path is
+is nil, or the load path is not pure relative, then it the path is
taken as-is.
If the file named by the path cannot be opened, then the
@@ -44966,7 +44968,9 @@ argument is a string.
If
.meta target
-specifies a relative pathname, then a special behavior applies.
+specifies a pure relative pathname, as defined by the
+.code pure-rel-path-p
+function, then a special behavior applies.
If an existing load operation is in progress, then the special variable
.code *load-path*
has a binding. In this case,
@@ -44977,7 +44981,7 @@ If
.code *load-path*
has the value
.codn nil ,
-then a relative
+then a pure relative
.meta target
pathname is used as-is, and thus resolved relative to the current working
directory.