summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2018-12-14 15:38:13 -0500
committerNat Goodspeed <nat@lindenlab.com>2018-12-14 15:38:13 -0500
commitc4096f670c7b3d43f8a5c1f65ef7e02033b0329d (patch)
tree29f3f8cae0dc5bfc983a25ec6e4e9afb245d4925 /indra/newview
parent132e708fec50fd756b822925313456c70a4ff27f (diff)
SL-10153: Review and rationalize fetching paths from environment.
Use LLStringUtil::getenv() or getoptenv() whenever we fetch a string that will be used as a pathname. Use LLFile::tmpdir() instead of getenv("TEMP"). As an added extra-special bonus, finally clean up $TMP/llcontrol-test-zzzzzz directories that have been accumulating every time we run a local build!
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llexternaleditor.cpp7
-rw-r--r--indra/newview/llwebprofile.cpp4
2 files changed, 6 insertions, 5 deletions
diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp
index df9c848cb8..776bbf78c2 100644
--- a/indra/newview/llexternaleditor.cpp
+++ b/indra/newview/llexternaleditor.cpp
@@ -31,6 +31,7 @@
#include "llui.h"
#include "llprocess.h"
#include "llsdutil.h"
+#include "llstring.h"
#include <boost/foreach.hpp>
// static
@@ -188,12 +189,12 @@ std::string LLExternalEditor::findCommand(
cmd = LLUI::sSettingGroups["config"]->getString(sSetting);
LL_INFOS() << "Using setting" << LL_ENDL;
}
- else // otherwise use the path specified by the environment variable
+ else // otherwise use the path specified by the environment variable
{
- char* env_var_val = getenv(env_var.c_str());
+ auto env_var_val(LLStringUtil::getoptenv(env_var));
if (env_var_val)
{
- cmd = env_var_val;
+ cmd = *env_var_val;
LL_INFOS() << "Using env var " << env_var << LL_ENDL;
}
}
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index 81d4e30a7a..8dcef2c7cd 100644
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -33,6 +33,7 @@
#include "llimagepng.h"
#include "llsdserialize.h"
+#include "llstring.h"
// newview
#include "llpanelprofile.h" // for getProfileURL(). FIXME: move the method to LLAvatarActions
@@ -264,6 +265,5 @@ void LLWebProfile::reportImageUploadStatus(bool ok)
std::string LLWebProfile::getAuthCookie()
{
// This is needed to test image uploads on Linux viewer built with OpenSSL 1.0.0 (0.9.8 works fine).
- const char* debug_cookie = getenv("LL_SNAPSHOT_COOKIE");
- return debug_cookie ? debug_cookie : sAuthCookie;
+ return LLStringUtil::getenv("LL_SNAPSHOT_COOKIE", sAuthCookie);
}