Bug 1428798 - UIGetEnv method, argument should be passed by reference r=gsvelto
authorJean-Luc Bonnafoux <jeanluc.bonnafoux@wanadoo.fr>
Mon, 08 Jan 2018 17:42:09 +0100
changeset 453725 090420884002e7e88f0f929290a21144dcc81536
parent 453724 5357dbb6df2b38e24d52c803ca0909adf6bc6f9a
child 453726 9fcef08d7bfbac2b43524ab06bbcb0d1b78ca70b
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgsvelto
bugs1428798
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1428798 - UIGetEnv method, argument should be passed by reference r=gsvelto MozReview-Commit-ID: 1O7WFBaMRfb
toolkit/crashreporter/client/crashreporter.h
toolkit/crashreporter/client/crashreporter_unix_common.cpp
toolkit/crashreporter/client/crashreporter_win.cpp
--- a/toolkit/crashreporter/client/crashreporter.h
+++ b/toolkit/crashreporter/client/crashreporter.h
@@ -162,15 +162,15 @@ void UIPruneSavedDumps(const std::string
 // If wait is true, wait for the program to terminate execution before
 // returning. Returns true if the program was launched correctly, false
 // otherwise.
 bool UIRunProgram(const std::string& exename,
                   const std::vector<std::string>& args,
                   bool wait = false);
 
 // Read the environment variable specified by name
-std::string UIGetEnv(const std::string name);
+std::string UIGetEnv(const std::string& name);
 
 #ifdef _MSC_VER
 # pragma warning( pop )
 #endif
 
 #endif
--- a/toolkit/crashreporter/client/crashreporter_unix_common.cpp
+++ b/toolkit/crashreporter/client/crashreporter_unix_common.cpp
@@ -158,17 +158,17 @@ std::ofstream* UIOpenWrite(const string&
 
   if (binary) {
     mode = mode | std::ios::binary;
   }
 
   return new std::ofstream(filename.c_str(), mode);
 }
 
-string UIGetEnv(const string name)
+string UIGetEnv(const string& name)
 {
   const char *var = getenv(name.c_str());
   if (var && *var) {
     return var;
   }
 
   return "";
 }
--- a/toolkit/crashreporter/client/crashreporter_win.cpp
+++ b/toolkit/crashreporter/client/crashreporter_win.cpp
@@ -1599,17 +1599,17 @@ bool UIRunProgram(const string& exename,
   }
 
   CloseHandle(pi.hProcess);
   CloseHandle(pi.hThread);
   return true;
 }
 
 string
-UIGetEnv(const string name)
+UIGetEnv(const string& name)
 {
   const wchar_t *var = _wgetenv(UTF8ToWide(name).c_str());
   if (var && *var) {
     return WideToUTF8(var);
   }
 
   return "";
 }