Skip to content

Commit f72eb2e

Browse files
committed
Merge branch '312-escaping-hotfix' of https://github.com/jacobwilliams/json-fortran into devel
2 parents 53da115 + b1ad067 commit f72eb2e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/json_string_utilities.F90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ subroutine escape_string(str_in, str_out, escape_solidus)
369369
if (escape_solidus) then
370370
str_out(ipos:ipos+1) = backslash//c
371371
ipos = ipos + 2
372+
else
373+
str_out(ipos:ipos) = c
374+
ipos = ipos + 1
372375
end if
373376
case(bspace)
374377
str_out(ipos:ipos+1) = '\b'

src/tests/jf_test_30.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ subroutine test_30(error_cnt)
2222
type(json_core) :: json_c
2323
integer :: i
2424

25-
character(kind=CK,len=*),parameter :: str = CK_'{"vars":{"a/first":1,"a\/second":2}}'
25+
character(kind=CK,len=*),parameter :: str = CK_'{"vars":{"a/first":1,"a\/second":2,"a\\b\\c\/third/blah/blah":3}}'
2626
character(len=*),dimension(2),parameter :: tf = ['True ','False']
2727

2828
error_cnt = 0

0 commit comments

Comments
 (0)