The data parser (used e.g. by DATA LIST) was unintentionally treating
soft separators (e.g. white space) followed by a hard separator (e.g.
a comma) as an empty field, but in fact it should be treated as just a
single separator. This fixes it and adds a test.
Thanks to pascal barbedor <pbarbedor@gmail.com> for reporting the problem.
/* Regular field. */
ss_get_chars (&p, ss_cspan (p, ds_ss (&parser->any_sep)), field);
*last_column = dfm_column_start (reader);
- if (!ss_ltrim (&p, parser->soft_seps) || ss_is_empty (p))
+ if (!ss_ltrim (&p, parser->soft_seps) || ss_is_empty (p)
+ || ss_find_char (parser->hard_seps, p.string[0]) != SIZE_MAX)
{
/* Advance past a trailing hard separator,
regardless of whether one actually existed. If
6
7,
8 9
-0,1,,,
+0,1 ,,,
,,,,
2