зеркало из https://github.com/mozilla/gecko-dev.git
Bug 381283 - Prevent macOS startup crashes on case sensitive file systems. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D218895
This commit is contained in:
Родитель
94c6346c5a
Коммит
fe71af1a1c
|
@ -10,10 +10,11 @@
|
|||
#include "base/process_util.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Omnijar.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
|
@ -84,15 +85,17 @@ bool nsMacUtilsImpl::GetAppPath(nsCString& aAppPath) {
|
|||
aAppPath.Assign(*sCachedAppPath);
|
||||
return true;
|
||||
}
|
||||
|
||||
nsAutoCString appPath;
|
||||
nsAutoCString appBinaryPath(
|
||||
(CommandLine::ForCurrentProcess()->argv()[0]).c_str());
|
||||
|
||||
// Ensure binary path is lowercase to avoid crash
|
||||
ToLowerCase(appBinaryPath);
|
||||
|
||||
// The binary path resides within the .app dir in Contents/MacOS,
|
||||
// e.g., Firefox.app/Contents/MacOS/firefox. Search backwards in
|
||||
// the binary path for the end of .app path.
|
||||
auto pattern = "/Contents/MacOS/"_ns;
|
||||
auto pattern = "/contents/macos/"_ns;
|
||||
nsAutoCString::const_iterator start, end;
|
||||
appBinaryPath.BeginReading(start);
|
||||
appBinaryPath.EndReading(end);
|
||||
|
|
Загрузка…
Ссылка в новой задаче