Replace all escaped slashes in json strings (closes #866)

${var/pattern/string} will only replace the first occurence. We should
use ${var//pattern/string} to replace all escaped slashes.
This commit is contained in:
Alexander Sulfrian
2022-02-04 20:34:22 +01:00
committed by Lukas Schauer
parent fa68ad8b23
commit 67b111a7b0

View File

@@ -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