Unix: Adding MOZILLA_FIVE_HOME

This commit is contained in:
dp%netscape.com 1999-03-11 21:31:16 +00:00
Родитель 694f4956da
Коммит 72ea641bee
2 изменённых файлов: 28 добавлений и 6 удалений

Просмотреть файл

@ -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