Index: src/terminal-screen.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-screen.c,v
retrieving revision 1.122
diff -u -r1.122 terminal-screen.c
--- src/terminal-screen.c	2 Feb 2006 18:32:11 -0000	1.122
+++ src/terminal-screen.c	16 Feb 2006 22:09:48 -0000
@@ -2390,6 +2390,38 @@
               uris[i] = old;
             else
               g_free (old);
+
+	    if (strchr (uris[i], ' ')) {
+	      old = uris[i];
+	      if (!strchr (uris[i], '"')) {
+		uris[i] = g_strdup_printf ("\"%s\"", old);
+	      }
+	      else if (!strchr (uris[i], '\'')) {
+		uris[i] = g_strdup_printf ("'%s'", old);
+	      }
+	      /* Both double and single quotes in filenames.  This
+	       * funky escaping mechanism brought to you courtesy
+	       * of [t]csh, which doesn't escape backslash escapes
+	       * in strings.  But then, this technique won't work
+	       * when dragging into interactive Python sessions or
+	       * something similar.  There's no optimal solution,
+	       * so I picked the one that worked best for me.
+	       */
+	      else {
+		gchar **strl;
+		strl = g_strsplit (old, "\"", -1);
+		printf ("fe\n");
+		uris[i] = g_strjoinv ("\"'\"'\"", strl);
+		printf ("fi\n");
+		g_free (old);
+		g_strfreev (strl);
+		printf ("fo\n");
+		old = uris[i];;
+		uris[i] = g_strdup_printf ("\"%s\"", old);
+		printf ("fum\n");
+	      }
+	      g_free (old);
+	    }
             
             ++i;
           }
