зеркало из https://github.com/mozilla/pjs.git
fixing bug #21085. xpinstall now quits gracefully when destination file already exists in a file move and file copy operation. r=cathleen
This commit is contained in:
Родитель
75c9537a73
Коммит
0f2779b74e
|
@ -640,6 +640,16 @@ nsInstallFileOpItem::NativeFileOpFileCopyPrepare()
|
||||||
return nsInstall::DOES_NOT_EXIST;
|
return nsInstall::DOES_NOT_EXIST;
|
||||||
else if(mTarget->IsFile())
|
else if(mTarget->IsFile())
|
||||||
return nsInstall::IS_FILE;
|
return nsInstall::IS_FILE;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nsFileSpec tempVar;
|
||||||
|
|
||||||
|
tempVar = *mTarget;
|
||||||
|
tempVar += mSrc->GetLeafName();
|
||||||
|
|
||||||
|
if(tempVar.Exists())
|
||||||
|
return nsInstall::ALREADY_EXISTS;
|
||||||
|
}
|
||||||
|
|
||||||
return nsInstall::SUCCESS;
|
return nsInstall::SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -749,8 +759,20 @@ nsInstallFileOpItem::NativeFileOpFileMovePrepare()
|
||||||
{
|
{
|
||||||
if(!mTarget->Exists())
|
if(!mTarget->Exists())
|
||||||
return nsInstall::DOES_NOT_EXIST;
|
return nsInstall::DOES_NOT_EXIST;
|
||||||
|
else if(mTarget->IsFile())
|
||||||
|
return nsInstall::IS_FILE;
|
||||||
else
|
else
|
||||||
return NativeFileOpFileCopyPrepare();
|
{
|
||||||
|
nsFileSpec tempVar;
|
||||||
|
|
||||||
|
tempVar = *mTarget;
|
||||||
|
tempVar += mSrc->GetLeafName();
|
||||||
|
|
||||||
|
if(tempVar.Exists())
|
||||||
|
return nsInstall::ALREADY_EXISTS;
|
||||||
|
else
|
||||||
|
return NativeFileOpFileCopyPrepare();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsInstall::SOURCE_DOES_NOT_EXIST;
|
return nsInstall::SOURCE_DOES_NOT_EXIST;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче