]> sigrok.org Git - libsigrok.git/blobdiff - src/input/csv.c
Change sr_dev_inst_new() to take no parameters.
[libsigrok.git] / src / input / csv.c
index 180ff3df264c6aaac50f43c69d1f710748e78115..b2756fa0aa124453dd266b2373896d2d06b37d21 100644 (file)
@@ -393,7 +393,7 @@ static int init(struct sr_input *in, GHashTable *options)
        struct context *inc;
        const char *s;
 
-       in->sdi = sr_dev_inst_new(SR_ST_ACTIVE, NULL, NULL, NULL);
+       in->sdi = sr_dev_inst_new();
        in->priv = inc = g_malloc0(sizeof(struct context));
 
        inc->single_column = g_variant_get_int32(g_hash_table_lookup(options, "single-column"));
@@ -667,6 +667,13 @@ static int process_buffer(struct sr_input *in)
                        continue;
                }
 
+               /* Skip the header line, its content was used as the channel names. */
+               if (inc->header) {
+                       sr_spew("Header line %zu skipped.", inc->line_number);
+                       inc->header = FALSE;
+                       continue;
+               }
+
                if (!(columns = parse_line(lines[l], inc, max_columns))) {
                        sr_err("Error while parsing line %zu.", inc->line_number);
                        return SR_ERR;