return SR_OK;
}
+static const char *delim_set = "\r\n";
+
static const char *get_line_termination(GString *buf)
{
const char *term;
columns = NULL;
line_number = 0;
- lines = g_strsplit_set(buf->str, "\r\n", 0);
+ lines = g_strsplit_set(buf->str, delim_set, 0);
for (l = 0; lines[l]; l++) {
line_number++;
line = lines[l];
inc->started = TRUE;
}
+ /* Limit the number of columns to parse. */
+ if (inc->multi_column_mode)
+ max_columns = inc->num_channels;
+ else
+ max_columns = 1;
+
p = g_strrstr_len(in->buf->str, in->buf->len, inc->termination);
if (!p)
/* Don't have a full line. */
*p = '\0';
g_strstrip(in->buf->str);
- /* Limit the number of columns to parse. */
- if (inc->multi_column_mode)
- max_columns = inc->num_channels;
- else
- max_columns = 1;
-
ret = SR_OK;
- lines = g_strsplit_set(in->buf->str, "\r\n", 0);
+ lines = g_strsplit_set(in->buf->str, delim_set, 0);
for (l = 0; lines[l]; l++) {
inc->line_number++;
line = lines[l];