diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-07-10 17:48:08 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-07-10 17:48:08 -0700 |
commit | c4679bf0951e4b21fcf4c447aa9ca2938e36e138 (patch) | |
tree | 71c7774be54a551a35b205e8f3c8ec9ddc75f30a | |
parent | 0a94efb0cac257a4e1c62bbe51b68dc10e154433 (diff) | |
download | txr-c4679bf0951e4b21fcf4c447aa9ca2938e36e138.tar.gz txr-c4679bf0951e4b21fcf4c447aa9ca2938e36e138.tar.bz2 txr-c4679bf0951e4b21fcf4c447aa9ca2938e36e138.zip |
compiler: disallow trailing slashes in path.
* stdlib/compiler.tl (open-compile-streams): If in-path end in
a path separator character, throw an error.
-rw-r--r-- | stdlib/compiler.tl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl index 0e8d8fe3..ad062e51 100644 --- a/stdlib/compiler.tl +++ b/stdlib/compiler.tl @@ -2165,8 +2165,10 @@ use-sym unuse-sym)) (defun open-compile-streams (in-path out-path test-fn) + (if (and (nullify in-path) + (find [in-path -1] path-sep-chars)) + (error "~s: invalid input pathname ~s" 'compile-file in-path)) (let* ((parent (or *load-path* "")) - (in-path (trim-right #/[\/\\]+/ in-path)) (in-path (if (and (pure-rel-path-p in-path) (not (empty parent))) (path-cat (dir-name parent) in-path) in-path)) |