1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-13 08:59:24 +00:00

Address issue #143

Fix some logic in module/expand-path.
This commit is contained in:
Calvin Rose 2019-07-15 17:35:29 -05:00
parent 0ca0180f27
commit e0fe8476aa
2 changed files with 9 additions and 0 deletions

View File

@ -218,6 +218,10 @@ static Janet janet_core_expand_path(int32_t argc, Janet *argv) {
}
dot_count = 0;
} else {
while (dot_count > 0) {
--dot_count;
*print++ = '.';
}
dot_count = -1;
*print++ = *scan;
}

View File

@ -130,4 +130,9 @@
(assert (not (string/find "\r" (get ((fiber/getenv (fiber/current)) 'cond) :doc))) "no \\r in doc strings")
# module/expand-path regression
(with-dyns [:syspath ".janet/.janet"]
(assert (= (string (module/expand-path "hello" ":sys:/:all:.janet"))
".janet/.janet/hello.janet") "module/expand-path 1"))
(end-suite)