summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/linux
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2016-10-04 18:35:39 +0000
committerTamas Berghammer <tberghammer@google.com>2016-10-04 18:35:39 +0000
commitfa262c98f8bb0618ed500b261e6098c63c93bfc6 (patch)
tree50bf70b666d60b12de64ce913c4956b372be5af7 /lldb/source/Host/linux
parentbdd6735a9e1ad7196c7d57dbda97ca91a97d7929 (diff)
downloadbcm5719-llvm-fa262c98f8bb0618ed500b261e6098c63c93bfc6.tar.gz
bcm5719-llvm-fa262c98f8bb0618ed500b261e6098c63c93bfc6.zip
Fix FixupEnvironment on Android after the Args refactor
llvm-svn: 283237
Diffstat (limited to 'lldb/source/Host/linux')
-rw-r--r--lldb/source/Host/linux/ProcessLauncherLinux.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lldb/source/Host/linux/ProcessLauncherLinux.cpp b/lldb/source/Host/linux/ProcessLauncherLinux.cpp
index a769f1aa91b..cc18fed8654 100644
--- a/lldb/source/Host/linux/ProcessLauncherLinux.cpp
+++ b/lldb/source/Host/linux/ProcessLauncherLinux.cpp
@@ -28,14 +28,15 @@ using namespace lldb_private;
static void FixupEnvironment(Args &env) {
#ifdef __ANDROID_NDK__
// If there is no PATH variable specified inside the environment then set the
- // path to /system/bin.
- // It is required because the default path used by execve() is wrong on
- // android.
+ // path to /system/bin. It is required because the default path used by
+ // execve() is wrong on android.
static const char *path = "PATH=";
static const int path_len = ::strlen(path);
- for (const char **args = env.GetConstArgumentVector(); *args; ++args)
- if (::strncmp(path, *args, path_len) == 0)
+ for (size_t i = 0; i < env.GetArgumentCount(); ++i) {
+ const char *arg = env.GetArgumentAtIndex(i);
+ if (::strncmp(path, arg, path_len) == 0)
return;
+ }
env.AppendArgument(llvm::StringRef("PATH=/system/bin"));
#endif
}
OpenPOWER on IntegriCloud