From 67b111a7b09374182bbba2bf3feecbbd549c0df2 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 4 Feb 2022 20:34:22 +0100 Subject: [PATCH] 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. --- dehydrated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3