Skip to content

Commit

Permalink
Replace all escaped slashes in json strings (closes #866)
Browse files Browse the repository at this point in the history
${var/pattern/string} will only replace the first occurence. We should
use ${var//pattern/string} to replace all escaped slashes.
  • Loading branch information
AlexanderS authored and lukas2511 committed Oct 31, 2022
1 parent fa68ad8 commit 67b111a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dehydrated
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ jsonsh() {
'[') parse_array "$jpath" ;;
# At this point, the only valid single-character tokens are digits.
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
*) value="${token/\\\///}"
*) value="${token//\\\///}"
# replace solidus ("\/") in json strings with normalized value: "/"
;;
esac
Expand Down

0 comments on commit 67b111a

Please sign in to comment.