Index: terminal-screen.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-screen.c,v
retrieving revision 1.125
diff -u -p -r1.125 terminal-screen.c
--- terminal-screen.c	10 Jul 2006 18:32:21 -0000	1.125
+++ terminal-screen.c	13 Jul 2006 14:10:18 -0000
@@ -2431,6 +2431,40 @@ drag_data_received  (GtkWidget *widget, 
             else
               g_free (old);
             
+            
+            /* If the file name contains any special char,
+             * double quote the file name and escape necessary 
+             * chars
+             */ 
+	    if (strpbrk (uris[i], " \t&()|;'{}`$*?\\\"") != NULL)
+	      {
+		gchar **pieces;
+
+                pieces = g_strsplit (uris[i], "\\", 0);
+                g_free (uris[i]);
+                uris[i] = g_strjoinv ("\\\\", pieces);
+                g_strfreev (pieces);
+		
+                pieces = g_strsplit (uris[i], "$", 0);
+                g_free (uris[i]);
+                uris[i] = g_strjoinv ("\\$", pieces);
+                g_strfreev (pieces);
+
+                pieces = g_strsplit (uris[i], "`", 0);
+                g_free (uris[i]);
+                uris[i] = g_strjoinv ("\\`", pieces);
+                g_strfreev (pieces);
+
+                pieces = g_strsplit (uris[i], "\"", 0);
+                g_free (uris[i]);
+                uris[i] = g_strjoinv ("\\\"", pieces);
+                g_strfreev (pieces);
+
+                old = uris[i];
+                uris[i] = g_strdup_printf ("\"%s\"", old);
+                g_free (old);		
+	    } 
+	    
             ++i;
           }
 
