Bug 325450 - nsGREGlue check of GRE_HOME needs to add /libxpcom.so, r=darin

This commit is contained in:
benjamin%smedbergs.us 2006-03-28 18:48:21 +00:00
parent a93a7ba7f6
commit b4e4416610

View File

@ -154,21 +154,25 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
// if GRE_HOME is in the environment, use that GRE
const char* env = getenv("GRE_HOME");
if (env && *env) {
char p[MAXPATHLEN];
snprintf(p, sizeof(p), "%s" XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL, env);
p[sizeof(p) - 1] = '\0';
#if XP_UNIX
if (realpath(env, aBuffer))
if (realpath(p, aBuffer))
return NS_OK;
#elif XP_WIN
if (_fullpath(aBuffer, env, aBufLen))
if (_fullpath(aBuffer, p, aBufLen))
return NS_OK;
#else
// hope for the best
// xxxbsmedberg: other platforms should have a "make absolute" function
#endif
if (strlen(env) >= aBufLen)
if (strlen(p) >= aBufLen)
return NS_ERROR_FILE_NAME_TOO_LONG;
strcpy(aBuffer, env);
strcpy(aBuffer, p);
return NS_OK;
}