fix Args function broken in r281942

The method was hard-coded to check only the 0th element of the array.
This manifested as NSLog messages behaving incorrectly on macOS.
(This is independent of the broken DarwinLog feature).

llvm-svn: 282128
This commit is contained in:
Todd Fiala 2016-09-22 00:59:23 +00:00
parent c9e3de35ed
commit 150aa321f7
1 changed files with 1 additions and 1 deletions

View File

@ -1002,7 +1002,7 @@ bool Args::ContainsEnvironmentVariable(llvm::StringRef env_var_name,
// Check each arg to see if it matches the env var name. // Check each arg to see if it matches the env var name.
for (size_t i = 0; i < GetArgumentCount(); ++i) { for (size_t i = 0; i < GetArgumentCount(); ++i) {
auto arg_value = llvm::StringRef::withNullAsEmpty(GetArgumentAtIndex(0)); auto arg_value = llvm::StringRef::withNullAsEmpty(GetArgumentAtIndex(i));
llvm::StringRef name, value; llvm::StringRef name, value;
std::tie(name, value) = arg_value.split('='); std::tie(name, value) = arg_value.split('=');