summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2016-01-16 10:50:40 -0500
committerJorge Aparicio <japaricious@gmail.com>2016-01-16 10:50:40 -0500
commita52a3abdc420f3fdacf1a4fea38e6e0ccee3596d (patch)
treecbaa7494b209c7b380576c7abd46bfbb5c6d8096
parent3d2f57cabe8fbb9ce098e04b55450d9a52d92946 (diff)
make get_clang_dir more robust
Similar to #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.
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c0455935..de2dbeca 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -275,7 +275,7 @@ fn get_clang_dir() -> Option<path::PathBuf>{
.file_name()
.and_then(|f| f.to_str())
.iter()
- .any(|&f| f == "clang") {
+ .any(|&f| f.starts_with("clang")) {
if let Some(dir) = real_path.parent() {
return Some(dir.to_path_buf())
}