зеркало из https://github.com/mozilla/pjs.git
bug 440634 - error passing DBCS settings path to crash reporter. r=bsmedberg a=ss
This commit is contained in:
Родитель
8c22329d17
Коммит
505f4d4b7a
|
@ -500,11 +500,19 @@ int main(int argc, char** argv)
|
|||
|
||||
// Hopefully the settings path exists in the environment. Try that before
|
||||
// asking the platform-specific code to guess.
|
||||
#ifdef XP_WIN32
|
||||
static const wchar_t kDataDirKey[] = L"MOZ_CRASHREPORTER_DATA_DIRECTORY";
|
||||
const wchar_t *settingsPath = _wgetenv(kDataDirKey);
|
||||
if (settingsPath && *settingsPath) {
|
||||
gSettingsPath = WideToUTF8(settingsPath);
|
||||
}
|
||||
#else
|
||||
static const char kDataDirKey[] = "MOZ_CRASHREPORTER_DATA_DIRECTORY";
|
||||
const char *settingsPath = getenv(kDataDirKey);
|
||||
if (settingsPath && *settingsPath) {
|
||||
gSettingsPath = settingsPath;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
string product = queryParameters["ProductName"];
|
||||
string vendor = queryParameters["Vendor"];
|
||||
|
|
|
@ -608,27 +608,31 @@ nsresult SetupExtraData(nsILocalFile* aAppDataDirectory,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Save this path in the environment for the crash reporter application.
|
||||
nsCAutoString dataDirEnv("MOZ_CRASHREPORTER_DATA_DIRECTORY=");
|
||||
|
||||
#if defined(XP_WIN32)
|
||||
nsAutoString dataDirEnv(NS_LITERAL_STRING("MOZ_CRASHREPORTER_DATA_DIRECTORY="));
|
||||
|
||||
nsAutoString dataDirectoryPath;
|
||||
rv = dataDirectory->GetPath(dataDirectoryPath);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
AppendUTF16toUTF8(dataDirectoryPath, dataDirEnv);
|
||||
dataDirEnv.Append(dataDirectoryPath);
|
||||
|
||||
_wputenv(dataDirEnv.get());
|
||||
#else
|
||||
// Save this path in the environment for the crash reporter application.
|
||||
nsCAutoString dataDirEnv("MOZ_CRASHREPORTER_DATA_DIRECTORY=");
|
||||
|
||||
nsCAutoString dataDirectoryPath;
|
||||
rv = dataDirectory->GetNativePath(dataDirectoryPath);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
dataDirEnv.Append(dataDirectoryPath);
|
||||
#endif
|
||||
|
||||
char* env = ToNewCString(dataDirEnv);
|
||||
NS_ENSURE_TRUE(env, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
PR_SetEnv(env);
|
||||
#endif
|
||||
|
||||
nsCAutoString data;
|
||||
if(NS_SUCCEEDED(GetOrInit(dataDirectory, NS_LITERAL_CSTRING("UserID"),
|
||||
|
|
Загрузка…
Ссылка в новой задаче