Skip to content

Commit a8381a3

Browse files
committed
Merge pull request #8 from dixel/patch-1
Decode escaped solidus
2 parents 263d6b0 + 430dd55 commit a8381a3

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

c_src/jsonx_str.h

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ check_with_unescape_jstr(unsigned char *str, unsigned char **endstr, unsigned ch
170170
case 'f' : {src++; *dst++ = 12U; continue;}
171171
case 'r' : {src++; *dst++ = 13U; continue;}
172172
case '"' : {src++; *dst++ = 34U; continue;}
173+
case '/' : {src++; *dst++ = 47U; continue;}
173174
case '\\': {src++; *dst++ = 92U; continue;}
174175
case 'u': {
175176
unsigned hval;

test/str_tests.erl

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ decstr1_test() ->
4949
<<"...">> = jsonx:decode(<<"\"...\"">>).
5050
decstr2_test() ->
5151
<<192, 128, 224, 128, 128, 240, 128, 128, 128>> = jsonx:decode(<<34,192,128,224,128,128,240,128,128,128,34>>).
52+
decstr3_test() ->
53+
<<"/">> = jsonx:decode(<<"\"\\/\"">>).
5254
decstre0_test() ->
5355
{error,invalid_string,0} = jsonx:decode(<<34,192,34>>).
5456
decstre01_test() ->

0 commit comments

Comments
 (0)