From: Luis de Bethencourt Date: Fri, 27 Mar 2015 17:16:03 +0000 (+0000) Subject: parse: check before truncating strings X-Git-Tag: 1.6.1~437 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c565c5ecb4f3dd766ff9156a4cf2d5d5adbc0396;p=platform%2Fupstream%2Fgstreamer.git 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 --- 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'; }