summaryrefslogtreecommitdiffstats
path: root/tools/llvm-ar
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-08-28 21:00:03 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-08-28 21:00:03 +0000
commit98b5be8062d33bde9a963c00326ce2483db18f9f (patch)
treeb302f70faa2ef32399d75b2b36ec30668fa50e00 /tools/llvm-ar
parentb5011bd2695cf6d4bdb2fa295abc5db37518d1cc (diff)
downloadexternal_llvm-98b5be8062d33bde9a963c00326ce2483db18f9f.zip
external_llvm-98b5be8062d33bde9a963c00326ce2483db18f9f.tar.gz
external_llvm-98b5be8062d33bde9a963c00326ce2483db18f9f.tar.bz2
Fix name matching to work on windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar')
-rw-r--r--tools/llvm-ar/llvm-ar.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp
index f47b0a6..e56e49ad 100644
--- a/tools/llvm-ar/llvm-ar.cpp
+++ b/tools/llvm-ar/llvm-ar.cpp
@@ -876,9 +876,10 @@ int main(int argc, char **argv) {
" This program archives bitcode files into single libraries\n"
);
- if (ToolName.endswith("ar"))
+ StringRef Stem = sys::path::stem(ToolName);
+ if (Stem.endswith("ar"))
return ar_main(argv);
- if (ToolName.endswith("ranlib"))
+ if (Stem.endswith("ranlib"))
return ranlib_main();
fail("Not ranlib or ar!");
}