mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 12:13:22 +00:00
Bug 151837 Export Bookmarks in Bookmark Manager saves nothing
r=pierrechanial@netscape.net, sr=blake, a=asa Must not delete/rename the temp file if tempFile == aBookmarksFile
This commit is contained in:
parent
b7e178f683
commit
1187bc9c8e
@ -5069,10 +5069,14 @@ nsBookmarksService::WriteBookmarks(nsFileSpec* aBookmarksFile, nsIRDFDataSource*
|
||||
// its place.
|
||||
if (succeeded) {
|
||||
char* bookmarksFileName = aBookmarksFile->GetLeafName();
|
||||
aBookmarksFile->Delete(PR_FALSE);
|
||||
|
||||
tempFile.Rename(bookmarksFileName);
|
||||
char* tempBookmarksFileName = tempFile.GetLeafName();
|
||||
// If tempFile == aBookmarksFile, we must not delete/rename
|
||||
if (nsCRT::strcmp(bookmarksFileName, tempBookmarksFileName)) {
|
||||
aBookmarksFile->Delete(PR_FALSE);
|
||||
tempFile.Rename(bookmarksFileName);
|
||||
}
|
||||
|
||||
nsCRT::free(tempBookmarksFileName);
|
||||
nsCRT::free(bookmarksFileName);
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user