/* 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));
}