if (!grePath) { grePath = getenv("MOZILLA_FIVE_HOME"); if (!grePath || !*grePath) { return nsnull;
char buffer[MAXPATHLEN];     if (GRE_GetCurrentProcessDirectory(buffer)) { PRUint32 pathlen = strlen(buffer); strcpy(buffer + pathlen, XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL);  struct stat libStat; int statResult = stat(buffer, &libStat);  if (statResult != -1) {  buffer[pathlen] = '\0'; strcpy(sXPCOMPath, buffer); return sXPCOMPath;
GRE_GetXPCOMPath(){  const char* grePath = GRE_GetGREPath();  if (!grePath) {    grePath = getenv("MOZILLA_FIVE_HOME");    if (!grePath || !*grePath) {      return nsnull;    }  }  sprintf(sXPCOMPath, "%s" XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL, grePath);  return sXPCOMPath;}