diff options
author | Christian Hesse <mail@eworm.de> | 2020-07-02 00:33:05 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-07-02 00:41:37 +0200 |
commit | 149340ff34c0bf13791c4fafc070f98589c6ce6e (patch) | |
tree | 66c2cff2be137b386b00d5312aa559601d2ce460 /global-functions | |
parent | 2aaea7c58e88ffa5df1daea1bc4da35a8f10811f (diff) |
global-functions: $ParseKeyValueStore: allow equals sign in value
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 6 |
1 files changed, 2 insertions, 4 deletions
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; } |