Skip to content

Commit

Permalink
[llvm-strip] Check "strip" with StringRef::contains instead of ends_with
Browse files Browse the repository at this point in the history
Summary: If argv[0] is version suffixed, e.g. llvm-strip-7, this will still work.

Reviewers: rupprecht, jhenderson, alexshap, jakehehrlich

Reviewed By: rupprecht

Subscribers: alexshap, jakehehrlich, llvm-commits

Differential Revision: https://reviews.llvm.org/D54193

llvm-svn: 346292
  • Loading branch information
MaskRay committed Nov 7, 2018
1 parent ccf35b4 commit 4a67035
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/tools/llvm-objcopy/llvm-objcopy.cpp
Expand Up @@ -219,7 +219,7 @@ int main(int argc, char **argv) {
InitLLVM X(argc, argv);
ToolName = argv[0];
DriverConfig DriverConfig;
if (sys::path::stem(ToolName).endswith_lower("strip"))
if (sys::path::stem(ToolName).contains("strip"))
DriverConfig = parseStripOptions(makeArrayRef(argv + 1, argc));
else
DriverConfig = parseObjcopyOptions(makeArrayRef(argv + 1, argc));
Expand Down

0 comments on commit 4a67035

Please sign in to comment.