Skip to content

Commit a52a3ab

Browse files
author
Jorge Aparicio
committed
make get_clang_dir more robust
Similar to rust-lang#242. In my system, clang is a symlink to a versioned clang (e.g. clang-3.7), and this equality check to "clang" was failing. This patch makes the check more robust so it can match "clang" or "clang-3.7", but still reject a symlink to ccache.
1 parent 3d2f57c commit a52a3ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ fn get_clang_dir() -> Option<path::PathBuf>{
275275
.file_name()
276276
.and_then(|f| f.to_str())
277277
.iter()
278-
.any(|&f| f == "clang") {
278+
.any(|&f| f.starts_with("clang")) {
279279
if let Some(dir) = real_path.parent() {
280280
return Some(dir.to_path_buf())
281281
}

0 commit comments

Comments
 (0)