diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -1179,16 +1179,16 @@ llvm::InitializeAllAsmParsers(); Stem = sys::path::stem(ToolName); - if (Stem.contains_lower("dlltool")) + if (Stem.endswith_lower("dlltool")) return dlltoolDriverMain(makeArrayRef(argv, argc)); - if (Stem.contains_lower("ranlib")) + if (Stem.endswith_lower("ranlib")) return ranlib_main(argc, argv); - if (Stem.contains_lower("lib")) + if (Stem.endswith_lower("lib")) return libDriverMain(makeArrayRef(argv, argc)); - if (Stem.contains_lower("ar")) + if (Stem.endswith_lower("ar")) return ar_main(argc, argv); fail("not ranlib, ar, lib or dlltool"); }