parse: escape \ with a \ as well, so that we don't lose the \ when unescaping

If we have a file called Foo\Bar.ogg, there is no way to pass
that filename properly to filesrc in gst_parse_launch(), since
gst_parse_unescape() will just unescape \x to x.

Not cherry-picking this into 0.10 since there are apparently
apps that work around this problem and which would break if
we fixed it there too.

https://bugzilla.gnome.org/show_bug.cgi?id=673319
This commit is contained in:
Christophe Fergeau 2012-06-27 19:59:29 +01:00 committed by Tim-Philipp Müller
parent e4301fe50f
commit dd9fedb41f

View file

@ -187,7 +187,7 @@ _gst_parse_escape (const gchar * str)
gstr = g_string_sized_new (strlen (str));
while (*str) {
if (*str == ' ')
if (*str == ' ' || *str == '\\')
g_string_append_c (gstr, '\\');
g_string_append_c (gstr, *str);
str++;