Skip to content

Commit 10c3286

Browse files
committed
Bugfix for missing unescaped quote
1 parent f9ed152 commit 10c3286

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/strsplit_csv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ strsplit_csv(char *sv[], int sv_size, char *str, const char *sep)
9393
// Otherwise, we are done with the quoted word.
9494
q = 0;
9595
}
96+
} else if (q > 0) {
97+
*p++ = *str;
9698
} else {
9799
// Start of quote.
98100
q = c;

test/t_strsplit_csv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ static testcase tests[] =
2929
_T("abc", "abc", 4), /* 0 */
3030
_T("abc,def,ghi", "abc;def;ghi", 5),
3131
_T("abc,def,ghi", "abc;def;ghi", 3),
32+
_T("abc,\"d'ef\",ghi", "abc;d'ef;ghi", 3),
3233
_T("\"abc\",def,xyz", "abc;def;xyz", 3),
3334
_T("\"abc\\\"x\",def,ghi", "abc\"x;def;ghi", 3),
3435
_T("\"abc\\\"x,y,z\",def,ghi", "abc\"x,y,z;def;ghi", 3),

0 commit comments

Comments
 (0)