According to the infos I have, VCD files should be plain ASCII, but
nonetheless DSView on Windows seems to add a UTF8 BOM at the beginning
of the file, so we need to skip it.

This fixes bug #755.

Signed-off-by: Wolfram Sang <[email protected]>
---
 src/input/vcd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/input/vcd.c b/src/input/vcd.c
index 66f126b..0908e61 100644
--- a/src/input/vcd.c
+++ b/src/input/vcd.c
@@ -105,6 +105,10 @@ static gboolean parse_section(GString *buf, gchar **name, 
gchar **contents)
        status = FALSE;
        pos = 0;
 
+       /* Skip UTF8 BOM */
+       if (buf->str[0] == '\xef' && buf->str[1] == '\xbb' && buf->str[2] == 
'\xbf')
+               pos = 3;
+
        /* Skip any initial white-space. */
        while (pos < buf->len && g_ascii_isspace(buf->str[pos]))
                pos++;
-- 
2.7.0


------------------------------------------------------------------------------
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to