From c565c5ecb4f3dd766ff9156a4cf2d5d5adbc0396 Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Fri, 27 Mar 2015 17:16:03 +0000 Subject: [PATCH] parse: check before truncating strings Don't truncate the last character of a string if it isn't necessary. https://bugzilla.gnome.org/show_bug.cgi?id=688625 --- gst/parse/grammar.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index 53ee15b..f75d9bf 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -390,7 +390,8 @@ static void gst_parse_element_set (gchar *value, GstElement *element, graph_t *g } pos++; while (g_ascii_isspace (*pos)) pos++; - if (*pos == '"') { + /* truncate a string if it is delimited with double quotes */ + if (*pos == '"' && pos[strlen (pos) - 1] == '"') { pos++; pos[strlen (pos) - 1] = '\0'; } -- 2.7.4