From: Alexander Sulfrian Date: Fri, 4 Feb 2022 19:34:22 +0000 (+0100) Subject: Replace all escaped slashes in json strings (closes #866) X-Git-Tag: v0.7.2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67b111a7b09374182bbba2bf3feecbbd549c0df2;p=thirdparty%2Fdehydrated.git 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. --- diff --git a/dehydrated b/dehydrated index 791fe41..c11d7d0 100755 --- a/dehydrated +++ b/dehydrated @@ -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