Skip to content

Commit e3520a2

Browse files
committed
FIX: opening a library (extension import) requires absolute path
1 parent 3a5f9e5 commit e3520a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mezz/sys-load.reb

+4-2
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ load-module: function [
450450
; Returns block of name, and either built module or none if delayed.
451451
; Returns none if source is word and no module of that name is loaded.
452452
; Returns none if source is file/url and read or load-extension fails.
453-
453+
;sys/log/info 'REBOL ["load-module:" source]
454454
assert/type [local none!] ; easiest way to protect against /local hacks
455455
if import [delay: none] ; /import overrides /delay
456456

@@ -472,6 +472,8 @@ load-module: function [
472472
binary? source [data: source]
473473
string? source [data: to binary! source]
474474
any [file? source url? source] [
475+
; if possible, make absolute source path
476+
if file? source [source: any [to-real-file source source]]
475477
tmp: file-type? source
476478
case [ ; Return none if read or load-extension fails
477479
not tmp [unless attempt [data: read source] [return none]]
@@ -687,7 +689,7 @@ import: function [
687689
; Unless /no-lib its exports are in lib already, so just import what we need.
688690
not no-lib [resolve/only system/contexts/user lib exports]
689691
]
690-
protect 'mod/lib-base
692+
protect 'mod/lib-base
691693
protect/hide 'mod/lib-boot
692694
mod ; module! returned
693695
]

0 commit comments

Comments
 (0)