Unix: Adding MOZILLA_FIVE_HOME
git-svn-id: svn://10.0.0.236/trunk@23767 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
6a3d01cd40
commit
6a616ea35a
@ -36,6 +36,7 @@
|
||||
#include <stdio.h>
|
||||
#elif defined(XP_UNIX)
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
@ -109,12 +110,22 @@ GetCurrentProcessDirectory(nsFileSpec& aFileSpec)
|
||||
|
||||
#elif defined(XP_UNIX)
|
||||
|
||||
// XXX This is wrong, but I don't know a better way to do it.
|
||||
// In the absence of a good way to get the executable directory let
|
||||
// us try this for unix:
|
||||
// - if MOZILLA_FIVE_HOME is defined, that is it
|
||||
// - else give the current directory
|
||||
char buf[MAXPATHLEN];
|
||||
if (getcwd(buf, sizeof(buf))) {
|
||||
aFileSpec = buf;
|
||||
char *moz5 = getenv("MOZILLA_FIVE_HOME");
|
||||
if (moz5) {
|
||||
aFileSpec = moz5;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (getcwd(buf, sizeof(buf))) {
|
||||
aFileSpec = buf;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
#include <stdio.h>
|
||||
#elif defined(XP_UNIX)
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
@ -109,12 +110,22 @@ GetCurrentProcessDirectory(nsFileSpec& aFileSpec)
|
||||
|
||||
#elif defined(XP_UNIX)
|
||||
|
||||
// XXX This is wrong, but I don't know a better way to do it.
|
||||
// In the absence of a good way to get the executable directory let
|
||||
// us try this for unix:
|
||||
// - if MOZILLA_FIVE_HOME is defined, that is it
|
||||
// - else give the current directory
|
||||
char buf[MAXPATHLEN];
|
||||
if (getcwd(buf, sizeof(buf))) {
|
||||
aFileSpec = buf;
|
||||
char *moz5 = getenv("MOZILLA_FIVE_HOME");
|
||||
if (moz5) {
|
||||
aFileSpec = moz5;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (getcwd(buf, sizeof(buf))) {
|
||||
aFileSpec = buf;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user