зеркало из https://github.com/mozilla/pjs.git
backing out dbragg's changes to fix 68001, dveditz suggested, r=dbragg
This commit is contained in:
Родитель
fe4d8af237
Коммит
021ac8ebab
|
@ -2511,32 +2511,23 @@ nsInstall::ExtractFileFromJar(const nsString& aJarfile, nsIFile* aSuggestedName,
|
|||
}
|
||||
else
|
||||
{
|
||||
// extract to the final destination.
|
||||
nsCOMPtr<nsIFile> temp;
|
||||
aSuggestedName->Clone(getter_AddRefs(temp));
|
||||
tempFile = do_QueryInterface(temp, &rv); //convert to an nsILocalFile
|
||||
tempFile = do_QueryInterface(temp, &rv);
|
||||
if (tempFile == nsnull)
|
||||
return nsInstall::OUT_OF_MEMORY;
|
||||
|
||||
//get the leafname so we can convert its extension to .new
|
||||
nsXPIDLCString leafName;
|
||||
tempFile->GetLeafName(getter_Copies(leafName));
|
||||
nsCString newLeafName (leafName);
|
||||
|
||||
PRInt32 extpos = newLeafName.RFindChar('.');
|
||||
if (extpos != -1)
|
||||
{
|
||||
// We found the extension;
|
||||
newLeafName.Truncate(extpos + 1); //strip off the old extension
|
||||
}
|
||||
newLeafName.Append("new");
|
||||
|
||||
//Now reset the leafname
|
||||
tempFile->SetLeafName(newLeafName.get());
|
||||
|
||||
MakeUnique(tempFile);
|
||||
extractHereSpec = tempFile;
|
||||
}
|
||||
|
||||
// We will overwrite what is in the way. is this something that we want to do?
|
||||
extractHereSpec->Delete(PR_FALSE);
|
||||
|
||||
//nsCOMPtr<nsILocalFile> file;
|
||||
//rv = NS_NewLocalFile(*extractHereSpec, PR_TRUE, getter_AddRefs(file));
|
||||
//if (NS_SUCCEEDED(rv))
|
||||
rv = mJarFileData->Extract(nsAutoCString(aJarfile), extractHereSpec);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче