[nautilus] file: don't crash when the original file path has reserved characters



commit d69885bd67edc1fae76c790f6162807817d63b2f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jan 29 18:41:22 2013 +0100

    file: don't crash when the original file path has reserved characters
    
    We shouldn't even try to unescape this, as GIO returns a valid path.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692737

 libnautilus-private/nautilus-file.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index a604eee..60a1954 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -7044,17 +7044,13 @@ nautilus_file_get_trash_original_file (NautilusFile *file)
 {
 	GFile *location;
 	NautilusFile *original_file;
-	char *filename;
 
 	original_file = NULL;
 
 	if (file->details->trash_orig_path != NULL) {
-		/* file name is stored in URL encoding */
-		filename = g_uri_unescape_string (file->details->trash_orig_path, "");
-		location = g_file_new_for_path (filename);
+		location = g_file_new_for_path (file->details->trash_orig_path);
 		original_file = nautilus_file_get (location);
-		g_object_unref (G_OBJECT (location));
-		g_free (filename);
+		g_object_unref (location);
 	}
 
 	return original_file;



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