Skip to content
Snippets Groups Projects
Commit 8395287e authored by Kirill Yukhin's avatar Kirill Yukhin
Browse files

Merge branch '1.9' into 1.10

parents ac590da8 a9695b98
No related branches found
No related tags found
No related merge requests found
......@@ -192,6 +192,7 @@ csv_parse_impl(struct csv *csv, const char *s, const char *end, bool firstonly)
/* end of field */
csv->state = CSV_LEADING_SPACES;
csv->bufp -= csv->ending_spaces;
csv->ending_spaces = 0;
if (firstonly) {
csv->state = CSV_NEWFIELD;
return p;
......
......@@ -36,7 +36,7 @@ local test6_ans = "|23|\t|456|\t|abcac|\t|'multiword field 4'|\t\n|none|" ..
"lag[ flag ])|\t\n||\t||\t||\t\n"
test = tap.test("csv")
test:plan(11)
test:plan(12)
readable = {}
readable.read = myread
......@@ -128,4 +128,9 @@ fio.unlink(file3)
fio.unlink(file4)
fio.rmdir(tmpdir)
-- gh-3489: crash with ending space and empty field
local res = csv.load('929,N1XDN ,,"Enfield, CT",')
local exp = {{'929', 'N1XDN', '', 'Enfield, CT', ''}}
test:is_deeply(res, exp, 'gh-3489')
test:check()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment