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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user