aboutsummaryrefslogtreecommitdiffstats
path: root/source/Host/posix/HostInfoPosix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Host/posix/HostInfoPosix.cpp')
-rw-r--r--source/Host/posix/HostInfoPosix.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/Host/posix/HostInfoPosix.cpp b/source/Host/posix/HostInfoPosix.cpp
index cfdbf5635ad1..d0ef2ca37061 100644
--- a/source/Host/posix/HostInfoPosix.cpp
+++ b/source/Host/posix/HostInfoPosix.cpp
@@ -242,3 +242,14 @@ HostInfoPosix::ComputePythonDirectory(FileSpec &file_spec)
return false;
#endif
}
+
+bool
+HostInfoPosix::GetEnvironmentVar(const std::string &var_name, std::string &var)
+{
+ if (const char *pvar = ::getenv(var_name.c_str()))
+ {
+ var = std::string(pvar);
+ return true;
+ }
+ return false;
+}