diff options
-rw-r--r-- | global-functions | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/global-functions b/global-functions index 043da42..1145200 100644 --- a/global-functions +++ b/global-functions @@ -44,6 +44,7 @@ :local ReplaceFrom [ :tostr $2 ]; :local ReplaceWith [ :tostr $3 ]; :local Len [ :len $ReplaceFrom ]; + :local Return ""; :if ($ReplaceFrom = "") do={ :return $String; @@ -51,10 +52,11 @@ :while ($String ~ $ReplaceFrom) do={ :local Pos [ :find $String $ReplaceFrom ]; - :set String ([ :pick $String 0 $Pos ] . $ReplaceWith . [ :pick $String ($Pos + $Len) 999 ]); + :set Return ($Return . [ :pick $String 0 $Pos ] . $ReplaceWith); + :set String [ :pick $String ($Pos + $Len) 999 ]; } - :return $String; + :return ($Return . $String); } # check and import required certificates |