]> spindle.queued.net Git - midori/commitdiff
Fix one more missing check in midori_view_save_source
authorChristian Dywan <christian@twotoasts.de>
Mon, 19 Mar 2012 18:09:32 +0000 (19:09 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 19 Mar 2012 18:09:32 +0000 (19:09 +0100)
midori/midori-view.c

index 707296771f910b1f3db72dc3eda95147034c7aa9..2e149783cba79f8b4f1a9eaeaf0e1922e77cac0e 100644 (file)
@@ -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);
             }
         }