Windows needs to use the CWD not the directory passed to the stub.

dougt's change r=ssu a=granrose.
This commit is contained in:
ssu%netscape.com 2000-01-25 20:44:55 +00:00
parent cbeb05e698
commit 3928747b1e

View File

@ -43,6 +43,7 @@
#include "plstr.h"
#ifdef XP_PC
#include <windows.h>
#include <direct.h>
#define COMPONENT_REG "component.reg"
#endif
@ -103,13 +104,21 @@ PR_PUBLIC_API(nsresult) XPI_Init(
{
rv = NS_ERROR_FAILURE;
}
#elif defined(XP_PC) || defined(XP_UNIX)
#elif defined(XP_PC)
char componentPath[MAX_PATH];
getcwd(componentPath, MAX_PATH);
nsCOMPtr<nsILocalFile> file;
NS_NewLocalFile(componentPath, getter_AddRefs(file));
rv = NS_InitXPCOM(&gServiceMgr, file);
#elif defined(XP_UNIX)
nsCOMPtr<nsILocalFile> file;
NS_NewLocalFile(aProgramDir, getter_AddRefs(file));
rv = NS_InitXPCOM(&gServiceMgr, file);
#else
rv = NS_InitXPCOM(&gServiceMgr, NULL);
#endif