X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Finput%2Fcsv.c;h=b2756fa0aa124453dd266b2373896d2d06b37d21;hb=0af636bed97c174bea46e61e961eaa1b0b162e0f;hp=180ff3df264c6aaac50f43c69d1f710748e78115;hpb=4ab01c3564ddec604d0b6a9daf76fcba277da287;p=libsigrok.git diff --git a/src/input/csv.c b/src/input/csv.c index 180ff3df..b2756fa0 100644 --- a/src/input/csv.c +++ b/src/input/csv.c @@ -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;