Skip to content

Commit caeb5ca

Browse files
committed
Use a correct env variables path separator on windows
1 parent 6e7f3c1 commit caeb5ca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/path.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,22 @@ pub fn find_lib_path() -> Result<PathBuf, Error> {
3030

3131
fn collect_possible_directories() -> Vec<PathBuf> {
3232
let mut paths = vec![];
33+
let separator = if cfg!(windows) { ';' } else { ':' };
3334

3435
if let Ok(lib_paths) = env::var("LD_LIBRARY_PATH") {
35-
for item in lib_paths.split(':') {
36+
for item in lib_paths.split(separator) {
3637
paths.push(PathBuf::from(item));
3738
}
3839
}
3940

4041
if let Ok(lib_paths) = env::var("DYLD_FALLBACK_LIBRARY_PATH") {
41-
for item in lib_paths.split(':') {
42+
for item in lib_paths.split(separator) {
4243
paths.push(PathBuf::from(item));
4344
}
4445
}
4546

4647
if let Ok(bin_paths) = env::var("PATH") {
47-
for item in bin_paths.split(':') {
48+
for item in bin_paths.split(separator) {
4849
let mut possible_path = PathBuf::from(item);
4950

5051
possible_path.pop();

0 commit comments

Comments
 (0)