From 76bc28c3f1cbd88f01eda7251e9f4f1d88c506f2 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Sat, 9 Jan 2016 18:27:14 +0100 Subject: [PATCH] input: vcd: try to continue when a vector was found No need to bail out on vectors. As long as there are tokens left, we can try to parse the rest. Also, print a message so the user knows what's going on. Here is a testcase vcd: $timescale 1 ns $end $var wire 1 n0 addr_0 $end $var wire 1 n1 addr_1 $end $enddefinitions $end #0 0n0 b1 n1 #1 1n0 b0 n1 #2 0n0 b1 n1 Signed-off-by: Wolfram Sang --- src/input/vcd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/input/vcd.c b/src/input/vcd.c index 91c22fca..6f84f659 100644 --- a/src/input/vcd.c +++ b/src/input/vcd.c @@ -407,8 +407,13 @@ static void parse_contents(const struct sr_input *in, char *data) break; } } else if (strchr("bBrR", tokens[i][0]) != NULL) { - /* A vector value, not supported yet. */ - break; + sr_dbg("Vector values not supported yet"); + if (!tokens[++i]) + /* No tokens left, bail out */ + break; + else + /* Process next token */ + continue; } else if (strchr("01xXzZ", tokens[i][0]) != NULL) { /* A new 1-bit sample value */ bit = (tokens[i][0] == '1');