Skip to content

Commit

Permalink
Fix booster startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Raine Makelainen committed Apr 9, 2014
1 parent 9c4020b commit 34b257d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions embedding/embedlite/utils/GeckoLoader.cpp
Expand Up @@ -107,7 +107,7 @@ GeckoLoader::InitEmbedding(const char* aProfilePath)
}

// create nsIFile pointing to appdir
char self[MAX_PATH];
char self[MAX_PATH] = "";
#ifdef WIN32
GetModuleFileNameA(GetModuleHandle(NULL), self, sizeof(self));
#else
Expand All @@ -121,11 +121,16 @@ GeckoLoader::InitEmbedding(const char* aProfilePath)
size_t lastslash_t = selfPath.find_last_of("/\\");
if (lastslash_t == std::string::npos) {
LOGE("Invalid module filename: %s", self);
#ifdef WIN32
return false;
#else
// A hackish way to get this initialized when starting through booster.
selfPath = std::string("/usr/bin");
#endif
} else {
selfPath = selfPath.substr(0, lastslash_t);
}

selfPath = selfPath.substr(0, lastslash_t);

nsCOMPtr<nsIFile> appdir;
rv = XRE_GetBinaryPath(selfPath.c_str(), getter_AddRefs(appdir));
if (NS_FAILED(rv)) {
Expand Down

0 comments on commit 34b257d

Please sign in to comment.