[Nautilus-list] Fix for crash on canceling delete (update)



Aehm, as it turns out my first take was a naive way to fix it.
There are other operations which don't involve a target and
file_operations_delete() shouldn't be called in all of these cases.
In addition to the original issue this version also fixes crashing on
canceling "empty trash".

Martin

Index: libnautilus-private/nautilus-file-operations.c
===================================================================
RCS file:
/cvs/gnome/nautilus/libnautilus-private/nautilus-file-operations.c,v
retrieving revision 1.138
diff -u -r1.138 nautilus-file-operations.c
--- libnautilus-private/nautilus-file-operations.c	2001/11/09
02:05:37	1.138
+++ libnautilus-private/nautilus-file-operations.c	2001/12/09 10:02:55
@@ -452,8 +452,10 @@
 		    TransferInfo *transfer_info)
 {
 	if (transfer_info->cancelled
-		&& progress_info->phase != GNOME_VFS_XFER_PHASE_COMPLETED) {
-		/* If cancelled, delete any partially copied files that are laying
+		&& progress_info->phase != GNOME_VFS_XFER_PHASE_COMPLETED
+        	&& progress_info->target_name != NULL) {
+		/* If cancelled and the operation involved a target,
+         	 * delete any partially copied files that are laying
 		 * around and return.
 		 */
 		if (progress_info->bytes_total != progress_info->bytes_copied) {







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