From 149340ff34c0bf13791c4fafc070f98589c6ce6e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 2 Jul 2020 00:33:05 +0200 Subject: global-functions: $ParseKeyValueStore: allow equals sign in value --- global-functions | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'global-functions') diff --git a/global-functions b/global-functions index a2a2ab4..b7f1846 100644 --- a/global-functions +++ b/global-functions @@ -423,8 +423,6 @@ # parse key value store :set ParseKeyValueStore do={ - :global CharacterReplace; - :local Source $1; :if ([ :typeof $Source ] != "array") do={ :set Source [ :tostr $1 ]; @@ -432,8 +430,8 @@ :local Result [ :toarray "" ]; :foreach KeyValue in=[ :toarray $Source ] do={ :if ([ :find $KeyValue "=" ]) do={ - :set KeyValue [ :toarray [ $CharacterReplace $KeyValue "=" "," ] ]; - :set ($Result->($KeyValue->0)) ($KeyValue->1); + :set ($Result->[ :pick $KeyValue 0 [ :find $KeyValue "=" ] ]) \ + [ :pick $KeyValue ([ :find $KeyValue "=" ] + 1) [ :len $KeyValue ] ]; } else={ :set ($Result->$KeyValue) true; } -- cgit v1.2.3-54-g00ecf