diff options
author | Rui Ueyama <ruiu@google.com> | 2013-10-22 17:56:55 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2013-10-22 17:56:55 +0000 |
commit | 23c5a3fbecee2d64689fdc4e560d5bd797554c60 (patch) | |
tree | 07ccd5174ec25a7443be186b1374c0942ede7397 | |
parent | 68bf30a8b42ab56cf2ba54de2caf4bfcabea039d (diff) | |
download | bcm5719-llvm-23c5a3fbecee2d64689fdc4e560d5bd797554c60.tar.gz bcm5719-llvm-23c5a3fbecee2d64689fdc4e560d5bd797554c60.zip |
[PECOFF] /manifestuac option is case insensitive.
llvm-svn: 193173
-rw-r--r-- | lld/lib/Driver/WinLinkDriver.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp index 74f730c6739..637e6f40eea 100644 --- a/lld/lib/Driver/WinLinkDriver.cpp +++ b/lld/lib/Driver/WinLinkDriver.cpp @@ -161,6 +161,13 @@ bool parseManifest(StringRef option, bool &enable, bool &embed, int &id) { return true; } +// Returns true if \p str starts with \p prefix, ignoring case. +bool startswith_lower(StringRef str, StringRef prefix) { + if (str.size() < prefix.size()) + return false; + return str.substr(0, prefix.size()).equals_lower(prefix); +} + // Parse /manifestuac:(level=<string>|uiAccess=<string>). // // The arguments will be embedded to the manifest XML file with no error check, @@ -172,15 +179,15 @@ bool parseManifestUac(StringRef option, llvm::Optional<std::string> &level, option = option.ltrim(); if (option.empty()) return true; - if (option.startswith("level=")) { + if (startswith_lower(option, "level=")) { option = option.substr(strlen("level=")); StringRef value; llvm::tie(value, option) = option.split(" "); level = value.str(); continue; } - if (option.startswith("uiAccess=")) { - option = option.substr(strlen("uiAccess=")); + if (startswith_lower(option, "uiaccess=")) { + option = option.substr(strlen("uiaccess=")); StringRef value; llvm::tie(value, option) = option.split(" "); uiAccess = value.str(); |