aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/mozilla-embed-persist.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp
index 404a0debf..b9f3e690c 100644
--- a/embed/mozilla/mozilla-embed-persist.cpp
+++ b/embed/mozilla/mozilla-embed-persist.cpp
@@ -183,20 +183,18 @@ impl_save (EphyEmbedPersist *persist)
/* Get the uri to save to */
nsCOMPtr<nsIURI> inURI;
- nsEmbedCString sURI;
if (uri)
{
- sURI.Assign (uri);
+ /* FIXME: origin charset!! */
+ rv = EphyUtils::NewURI (getter_AddRefs(inURI), nsEmbedCString(uri));
+ NS_ENSURE_SUCCESS (rv, FALSE);
}
else
{
- rv = browser->GetDocumentUrl (sURI);
+ rv = browser->GetDocumentURI (getter_AddRefs (inURI));
NS_ENSURE_SUCCESS (rv, FALSE);
}
- rv = EphyUtils::NewURI (getter_AddRefs(inURI), sURI);
- NS_ENSURE_SUCCESS (rv, FALSE);
-
/* Get post data */
nsCOMPtr<nsIInputStream> postData;
if (browser)
@@ -245,7 +243,7 @@ impl_save (EphyEmbedPersist *persist)
*/
NS_ENSURE_TRUE (!(flags & EPHY_EMBED_PERSIST_COPY_PAGE) || pageDescriptor, FALSE);
- if (filename == NULL)
+ if (filename == NULL || filename[0] == '\0')
{
/* Create an header sniffer and do the save */
nsCOMPtr<nsIWebBrowserPersist> webPersist =