diff --git a/xpcom/reflect/xptinfo/src/xptiManifest.cpp b/xpcom/reflect/xptinfo/src/xptiManifest.cpp index f2a9e80e3f2..21891aac69a 100644 --- a/xpcom/reflect/xptinfo/src/xptiManifest.cpp +++ b/xpcom/reflect/xptinfo/src/xptiManifest.cpp @@ -131,6 +131,7 @@ PRBool xptiManifest::Write(xptiInterfaceInfoManager* aMgr, PRUint32 size32; PRIntn interfaceCount = 0; nsCAutoString appDirString; + nsCOMPtr greDirectory; nsCOMPtr tempFile; if(!aMgr->GetCloneOfManifestDir(getter_AddRefs(tempFile)) || !tempFile) @@ -177,6 +178,8 @@ PRBool xptiManifest::Write(xptiInterfaceInfoManager* aMgr, (int) aWorkingSet->GetDirectoryCount())) goto out; + NS_GetSpecialDirectory(NS_GRE_COMPONENT_DIR, getter_AddRefs(greDirectory)); + for(i = 0; i < aWorkingSet->GetDirectoryCount(); i++) { nsCOMPtr dir; @@ -186,9 +189,19 @@ PRBool xptiManifest::Write(xptiInterfaceInfoManager* aMgr, if(!dir) goto out; - dir->GetPersistentDescriptor(str); - if(str.IsEmpty()) - goto out; + PRBool isGREDir = PR_FALSE; + if (greDirectory) + dir->Equals(greDirectory, &isGREDir); + + if (isGREDir) { + str = "gre"; + } + else + { + dir->GetPersistentDescriptor(str); + if(str.IsEmpty()) + goto out; + } if(!PR_fprintf(fd, "%d,%s\n", (int) i, str.get())) goto out; @@ -491,6 +504,8 @@ PRBool xptiManifest::Read(xptiInterfaceInfoManager* aMgr, for(i = 0; i < dirCount; ++i) { + nsCAutoString str; + if(!reader.NextLine()) goto out; @@ -502,8 +517,23 @@ PRBool xptiManifest::Read(xptiInterfaceInfoManager* aMgr, if(i != atoi(values[0])) goto out; + if (0 != PL_strcmp(values[1], "gre")) + { + nsCOMPtr greDirectory; + NS_GetSpecialDirectory(NS_GRE_COMPONENT_DIR, getter_AddRefs(greDirectory)); + nsCOMPtr lFile = do_QueryInterface(greDirectory); + if (!lFile) + goto out; + + lFile->GetPersistentDescriptor(str); + } + else + { + str = values[1]; + } + // directoryname - if(!aWorkingSet->DirectoryAtMatchesPersistentDescriptor(i, values[1])) + if(!aWorkingSet->DirectoryAtMatchesPersistentDescriptor(i, str.get())) goto out; }