Now adjusting the nsFileSpec after a Move().

Also fixing a bug with Rename().  Now it should successfully take
partial pathnames on Unix and Windows.


git-svn-id: svn://10.0.0.236/trunk@24612 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
1999-03-21 06:22:45 +00:00
parent 80c6b191c1
commit 61ba04689f
8 changed files with 76 additions and 20 deletions

View File

@@ -816,7 +816,7 @@ nsresult nsFileSpec::Copy(const nsFileSpec& newParentDir) const
} // nsFileSpec::Copy
//----------------------------------------------------------------------------------------
nsresult nsFileSpec::Move(const nsFileSpec& newParentDir) const
nsresult nsFileSpec::Move(const nsFileSpec& newParentDir)
//----------------------------------------------------------------------------------------
{
// We can only move into a directory
@@ -827,6 +827,9 @@ nsresult nsFileSpec::Move(const nsFileSpec& newParentDir) const
nsresult result = NS_FILE_RESULT(::FSpMoveRenameCompat(&mSpec,
&newParentDir.mSpec,
const_cast<StringPtr>(GetLeafPName())));
if ( NS_SUCCEEDED(result) )
*this = newParentDir + GetLeafName();
return result;
} // nsFileSpec::Move