Patch from xavier.bestel@free.fr to fix bug 83994. Properly escapes filenames in...
authorDavid Schleef <ds@schleef.org>
Mon, 1 Jul 2002 21:37:21 +0000 (21:37 +0000)
committerDavid Schleef <ds@schleef.org>
Mon, 1 Jul 2002 21:37:21 +0000 (21:37 +0000)
Original commit message from CVS:
Patch from xavier.bestel@free.fr to fix bug 83994.  Properly escapes
filenames in location= when converting them to URIs.  There are subtle
namespace clashes between URIs and filenames, but they're mostly
stupid.

ext/gnomevfs/gstgnomevfssrc.c

index 56ade572b48a40b3f0f286afdb70c8e9bbf1353a..af9e3d25a7d7b33ce59381fcaeaa4f94e9dfc08e 100644 (file)
@@ -268,10 +268,14 @@ static void gst_gnomevfssrc_set_property(GObject *object, guint prop_id, const G
                         /* if it's not a proper uri, default to file: -- this
                          * is a crude test */
                         if (!strchr (location, ':'))
-                                if (*location == '/')
-                                        src->filename = g_strdup_printf ("file://%s", location);
+                       {
+                               gchar *newloc = gnome_vfs_escape_path_string(location);
+                                if (*newloc == '/')
+                                        src->filename = g_strdup_printf ("file://%s", newloc);
                                 else
-                                        src->filename = g_strdup_printf ("file://%s/%s", getcwd(cwd, PATH_MAX), location);
+                                        src->filename = g_strdup_printf ("file://%s/%s", getcwd(cwd, PATH_MAX), newloc);
+                               g_free(newloc);
+                       }
                         else
                                 src->filename = g_strdup (g_value_get_string (value));
                }