From 150aa321f7a3988d69f34c6596d366f6fc4f98e0 Mon Sep 17 00:00:00 2001 From: Todd Fiala Date: Thu, 22 Sep 2016 00:59:23 +0000 Subject: [PATCH] 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 --- lldb/source/Interpreter/Args.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp index 6b6fe46..36ea78c 100644 --- a/lldb/source/Interpreter/Args.cpp +++ b/lldb/source/Interpreter/Args.cpp @@ -1002,7 +1002,7 @@ bool Args::ContainsEnvironmentVariable(llvm::StringRef env_var_name, // Check each arg to see if it matches the env var name. 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; std::tie(name, value) = arg_value.split('='); -- 2.7.4