diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-05-08 23:33:22 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-05-15 23:04:09 +1000 |
| commit | 18c13de5e6dfd4631f9ed05e0ab49305bf0384ac (patch) | |
| tree | 333a241d58716b35a8eb47c34a4eabb1e4ade7b2 /src/libstd | |
| parent | b1ee3200b52a87ba788a6edf3b14db9466f2cb7d (diff) | |
| download | rust-18c13de5e6dfd4631f9ed05e0ab49305bf0384ac.tar.gz rust-18c13de5e6dfd4631f9ed05e0ab49305bf0384ac.zip | |
std:: switch the order in which dynamic_lib adds search paths.
The compiler needs to be opening e.g. libregex in the correct directory, which requires getting these in the right order.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/unstable/dynamic_lib.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libstd/unstable/dynamic_lib.rs b/src/libstd/unstable/dynamic_lib.rs index 87d531cc627..b2a912e65a8 100644 --- a/src/libstd/unstable/dynamic_lib.rs +++ b/src/libstd/unstable/dynamic_lib.rs @@ -16,8 +16,8 @@ A simple wrapper over the platform's dynamic library facilities */ + use c_str::ToCStr; -use iter::Iterator; use mem; use ops::*; use option::*; @@ -25,7 +25,7 @@ use os; use path::GenericPath; use path; use result::*; -use slice::{Vector,OwnedVector}; +use slice::Vector; use str; use vec::Vec; @@ -75,10 +75,12 @@ impl DynamicLibrary { } else { ("LD_LIBRARY_PATH", ':' as u8) }; - let newenv = os::getenv_as_bytes(envvar).unwrap_or(box []); - let mut newenv = newenv.move_iter().collect::<Vec<_>>(); - newenv.push_all(&[sep]); - newenv.push_all(path.as_vec()); + let mut newenv = Vec::from_slice(path.as_vec()); + newenv.push(sep); + match os::getenv_as_bytes(envvar) { + Some(bytes) => newenv.push_all(bytes), + None => {} + } os::setenv(envvar, str::from_utf8(newenv.as_slice()).unwrap()); } |
