diff options
| author | Steven Fackler <sfackler@gmail.com> | 2014-01-17 21:35:18 -0800 |
|---|---|---|
| committer | Steven Fackler <sfackler@gmail.com> | 2014-01-17 21:51:38 -0800 |
| commit | 1e20960f794a820791d4cb64e35d7c03ec505065 (patch) | |
| tree | ed3f680e2d94f8bc21ee38789b114fc0a96843e7 /src/libsyntax | |
| parent | 2ff358c062e9f4c31e0e34d0cd9179a9af363867 (diff) | |
Actually force a / in the path for ext crates
If the library is in the working directory, its path won't have a "/"
which will cause dlopen to search /usr/lib etc. It turns out that Path
auto-normalizes during joins so Path::new(".").join(path) is actually a
no-op.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 7d46f6e4594..13bb2770c8e 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -31,6 +31,7 @@ use util::small_vector::SmallVector; use std::vec; use std::unstable::dynamic_lib::DynamicLibrary; +use std::os; pub fn expand_expr(e: @ast::Expr, fld: &mut MacroExpander) -> @ast::Expr { match e.node { @@ -402,8 +403,7 @@ fn load_extern_macros(crate: &ast::ViewItem, fld: &mut MacroExpander) { None => return }; // Make sure the path contains a / or the linker will search for it. - // If path is already absolute this is a no-op. - let path = Path::new(".").join(path); + let path = os::make_absolute(&path); let registrar = match fld.cx.loader.get_registrar_symbol(cnum) { Some(registrar) => registrar, |
