Bug 1345413 - Don't crash if LOGNAME is not set in the environment, r?glandium
MozReview-Commit-ID: BA6swHHuPc6
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -3808,16 +3808,19 @@ XREMain::XRE_mainStartup(bool* aExitFlag
}
}
if (!newInstance) {
nsAutoCString program(gAppData->remotingName);
ToLowerCase(program);
const char* username = getenv("LOGNAME");
+ if (!username) {
+ username = "";
+ }
const char* profile = nullptr;
RemoteResult rr = ParseRemoteCommandLine(program, &profile, &username);
if (rr == REMOTE_ARG_BAD) {
return 1;
}
nsCOMPtr<nsIFile> mutexDir;