validate: Handle comments in multiline expressions
authorThibault Saunier <tsaunier@igalia.com>
Wed, 22 Apr 2020 17:02:29 +0000 (13:02 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Wed, 22 Apr 2020 17:02:29 +0000 (13:02 -0400)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/179>

validate/gst/validate/gst-validate-utils.c

index 4fa5d5b..1f7e817 100644 (file)
@@ -608,8 +608,13 @@ _file_get_structures (GFile * file, gchar ** err)
     l = g_string_new (NULL);
     current_lineno = lineno;
     while (*tmp != '\n' && *tmp) {
-      gchar next = *(tmp + 1);
+      gchar next;
 
+      if (*tmp == '#')
+        while (*tmp && *tmp != '\n')
+          tmp++;
+
+      next = *(tmp + 1);
       if (next && next == '\n'
           && strchr (GST_STRUCT_LINE_CONTINUATION_CHARS, *tmp)) {
         if (*tmp != '\\')