diff mbox series

[3/3] jshn.sh: Add anonymous strings in arrays

Message ID mailman.110881.1754253072.1866309.openwrt-devel@lists.openwrt.org
State New
Headers show
Series [1/3] jshn.sh: Send warnings to stderr | expand

Commit Message

Philip Prindeville Aug. 3, 2025, 8:31 p.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
From: Philip Prindeville <philipp@redfish-solutions.com>

---
 sh/jshn.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/sh/jshn.sh b/sh/jshn.sh
index e9c6a033981a1e877cf8de3a330b640e5094bf99..75faf8245841a0ba766548e79a14c8a24eceed24 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -150,6 +150,17 @@  json_add_string() {
 	_json_add_generic string "$1" "$2" "$cur"
 }
 
+json_push_string() {
+	local cur
+	_json_get_var cur JSON_CUR
+	[ "${cur%%[0-9]*}" = "J_A" ] || {
+		[ -n "$_json_no_warning" ] || \
+			echo "WARNING: Not in an array" >&2
+		return 1
+	}
+	_json_add_generic string "" "$2" "$cur"
+}
+
 json_add_int() {
 	local cur
 	_json_get_var cur JSON_CUR