Hi,

this fixes situations where \r\n is used as newline. Only one character is
pulled from buffer instead of 2 when this kind of newline is used.

This should laso fix bugs:
http://sigrok.org/bugzilla/show_bug.cgi?id=635
http://sigrok.org/bugzilla/show_bug.cgi?id=817

with best regards,
        P
>From 265cff6b2e41a0dd64c0ca7de8c5b9cbc6fde05a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pinkava?= <j...@seznam.cz>
Date: Thu, 24 Nov 2016 21:32:46 +0100
Subject: [PATCH] csv: Fix exception for files with \r\n newlines

---
 src/input/csv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/input/csv.c b/src/input/csv.c
index 8d151fd..911e248 100644
--- a/src/input/csv.c
+++ b/src/input/csv.c
@@ -705,7 +705,7 @@ static int process_buffer(struct sr_input *in)
 		g_strfreev(columns);
 	}
 	g_strfreev(lines);
-	g_string_erase(in->buf, 0, p - in->buf->str + 1);
+	g_string_erase(in->buf, 0, p - in->buf->str + strlen(inc->termination));
 
 	return ret;
 }
-- 
2.10.2

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to