eog r5075 - in trunk: . src



Author: friemann
Date: Tue Mar 24 14:49:49 2009
New Revision: 5075
URL: http://svn.gnome.org/viewvc/eog?rev=5075&view=rev

Log:
2009-03-24  Felix Riemann  <friemann svn gnome org>

	* src/eog-image.c: (tmp_file_move_to_uri): Fix GError usage and
	avoid crashes when the tempfile can't be moved to the destination.
	Fixes bug #576558 (Josselin Mouette, Felix Riemann).


Modified:
   trunk/ChangeLog
   trunk/src/eog-image.c

Modified: trunk/src/eog-image.c
==============================================================================
--- trunk/src/eog-image.c	(original)
+++ trunk/src/eog-image.c	Tue Mar 24 14:49:49 2009
@@ -1326,7 +1326,7 @@
 		      GError **error)
 {
 	gboolean result;
-	GError **ioerror = NULL;
+	GError *ioerror = NULL;
 
 	result = g_file_move (tmpfile,
 			      file,
@@ -1335,20 +1335,20 @@
 			      NULL,
 			      (GFileProgressCallback) transfer_progress_cb,
 			      image,
-			      ioerror);
+			      &ioerror);
 
 	if (result == FALSE) {
-		if (g_error_matches (*ioerror, G_IO_ERROR,
+		if (g_error_matches (ioerror, G_IO_ERROR,
 				     G_IO_ERROR_EXISTS)) {
 			g_set_error (error, EOG_IMAGE_ERROR,
 				     EOG_IMAGE_ERROR_FILE_EXISTS,
 				     "File exists");
 		} else {
-		g_set_error (error, EOG_IMAGE_ERROR,
-			     EOG_IMAGE_ERROR_VFS,
-			     "VFS error moving the temp file");
+			g_set_error (error, EOG_IMAGE_ERROR,
+				     EOG_IMAGE_ERROR_VFS,
+				     "VFS error moving the temp file");
 		}
-		g_error_free (*ioerror);
+		g_clear_error (&ioerror);
 	}
 
 	return result;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]