[Xfce4-commits] <midori:master> Fix one more missing check in midori_view_save_source

Christian Dywan noreply at xfce.org
Mon Mar 19 19:18:02 CET 2012


Updating branch refs/heads/master
         to d98edca5f2f7a46b3684bcf595e72564db79b12b (commit)
       from edc88b7b47b598839120468605a150e760a0c092 (commit)

commit d98edca5f2f7a46b3684bcf595e72564db79b12b
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Mar 19 19:09:32 2012 +0100

    Fix one more missing check in midori_view_save_source

 midori/midori-view.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 7072967..2e14978 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -5146,7 +5146,7 @@ midori_view_can_save (MidoriView* view)
     return FALSE;
 }
 
-/* static */ gchar*
+static gchar*
 midori_view_get_uri_extension (const gchar* uri)
 {
     gchar* slash;
@@ -5248,10 +5248,11 @@ midori_view_save_source (MidoriView* view,
         {
             ret = fwrite (data ? data->str : "", 1, data ? data->len : 0, fp);
             fclose (fp);
-            if ((ret - data->len) != 0)
+            if (ret - (data ? data->len : 0) != 0)
             {
-                g_warning ("Error writing to file %s "
-                           "in midori_browser_source_transfer_cb()", unique_filename);
+                midori_view_add_info_bar (view, GTK_MESSAGE_ERROR,
+                    unique_filename, NULL, view,
+                    GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
                 katze_assign (unique_filename, NULL);
             }
         }


More information about the Xfce4-commits mailing list